/* =========================================================================
   James Montgomery — landing page
   ========================================================================= */

@font-face {
  font-family: "U8";
  src: url("../fonts/U8-Thin.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "U8";
  src: url("../fonts/U8-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "U8";
  src: url("../fonts/U8-RegularItalic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "U8";
  src: url("../fonts/U8-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "U8";
  src: url("../fonts/U8-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #2a2a2a;
  --bg-2: #1f1f1f;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.50);
  --separator: rgba(255, 255, 255, 0.18);
  --frame: rgba(255, 255, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.06);
  --panel-blur: rgba(35, 35, 35, 0.45);
  --pad: 28px;
  --radius: 4px;
  --font: "U8", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* =========================================================================
   Background portrait — fixed full-bleed, desaturated
   ========================================================================= */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  overflow: hidden;
}

.bg__still,
.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: contrast(1.03) brightness(0.9);
}

/* Still poster sits underneath; two players crossfade on top to mask the loop seam. */
.bg__video {
  opacity: 0;
  transition: opacity 1s ease;
}

@media (max-width: 900px) {
  .bg__still,
  .bg__video { object-position: 18% center; }
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      rgba(20, 20, 20, 0.10) 0%,
      rgba(20, 20, 20, 0.20) 45%,
      rgba(20, 20, 20, 0.55) 100%);
  pointer-events: none;
}

/* =========================================================================
   Outer frame (the 1px outline you see in the reference)
   ========================================================================= */

.frame {
  position: relative;
  height: 100vh;
  height: 100dvh;
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.frame__inner {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--frame);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 36px 36px 84px;
  overflow: hidden;
}

@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow: visible; }

  .frame {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 14px;
    overflow: visible;
  }
  .frame__inner {
    flex: 1 0 auto;
    min-height: auto;
    padding: 24px 22px 76px;
    overflow: visible;
  }
}

/* =========================================================================
   Name card — bottom-left of the photo area
   ========================================================================= */

.namecard {
  position: relative;
  align-self: start;
  z-index: 1;
  max-width: 520px;
  padding-bottom: 8px;
}

.namecard__name {
  margin: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text);
  text-transform: uppercase;
}

.namecard__role {
  margin: 10px 0 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
}

@media (max-width: 900px) {
  .namecard { padding-top: 0; }
}

/* =========================================================================
   Right panel — frosted glass card
   ========================================================================= */

.panel {
  --panel-text: #ffffff;
  --panel-text-dim: #ffffff;
  --panel-text-faint: #ffffff;
  --panel-separator: #ffffff;
  position: relative;
  z-index: 1;
  align-self: flex-start;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  margin-top: 28px;
  color: var(--panel-text);
  overflow: hidden;
  min-height: 0;
}

.panel__scale {
  width: min(1040px, calc(100vw - 180px));
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 40px 40px 36px;
  transform-origin: top left;
}

.panel__main,
.panel__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top-align both columns by dropping the side column's leading offset. */
.panel__side > .eyebrow--projects:first-child { margin-top: 0; }

@media (max-width: 900px) {
  .panel {
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    margin: 28px 0 0;
  }
  .panel__scale {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 26px 22px;
    transform-origin: top center;
  }
  .panel__side > .eyebrow--projects:first-child { margin-top: 32px; }

  /* Keep the full email address on one line, shrinking to fit narrow screens. */
  .panel__email {
    white-space: nowrap;
    font-size: clamp(9px, calc((100vw - 128px) / 19), 15px);
  }
}

.panel .eyebrow {
  display: inline-block;
  font-family: var(--font);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--panel-text-faint);
  margin-bottom: 14px;
}

.eyebrow--projects { margin-top: 32px; }

.panel__heading {
  margin: 0 0 22px;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #ffffff;
}

@media (min-width: 901px) {
  /* Keep the heading on a single line, shrinking to fit the column. */
  .panel__heading {
    white-space: nowrap;
    font-size: clamp(24px, 2.6vw, 40px);
  }
}

.panel__lead {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--panel-text-dim);
  max-width: none;
}

.panel__email {
  display: inline-block;
  margin-top: 10px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.panel__email:hover { border-bottom-color: #ffffff; }

.panel__linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 0 4px;
  color: #ffffff;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.panel__linkedin:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.panel__linkedin svg { display: block; }

/* =========================================================================
   Previous employment & engagements — logo lockup
   ========================================================================= */

.employment {
  border-top: 1px solid var(--panel-separator);
  padding-top: 18px;
}

.employment__logos {
  width: 100%;
  height: auto;
}

/* =========================================================================
   Stats / Projects list — adapted from the numbered list in the reference
   ========================================================================= */

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--panel-separator);
}

.stat {
  border-bottom: 1px solid var(--panel-separator);
}

.stat__link,
.stat__link--inert {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--panel-text);
  transition: background 0.2s ease, padding 0.2s ease;
}

.stat__link:hover {
  background: rgba(255, 255, 255, 0.10);
  padding-left: 10px;
  padding-right: 10px;
}

.stat__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.10);
}

.stat__label {
  font-family: var(--font);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--panel-text);
}

.stat__action {
  font-family: var(--font);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--panel-text-faint);
  white-space: nowrap;
}

.stat--soon .stat__label { color: var(--panel-text-faint); }
.stat--soon .stat__icon { opacity: 0.55; }
.stat__link--inert { cursor: default; }

/* =========================================================================
   Bottom bar
   ========================================================================= */

.bottombar {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.bottombar > * { pointer-events: auto; }

.bottombar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--separator);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.2s;
}

.bottombar__link:hover { background: rgba(255, 255, 255, 0.14); }

.bottombar__arrow {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
}

.bottombar__pill {
  font-family: var(--font);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--separator);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bottombar__year {
  font-family: var(--font);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-faint);
}

@media (max-width: 900px) {
  .bottombar {
    left: 22px;
    right: 22px;
    bottom: 22px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
