/* Portfolio page styles — layered on top of design-tokens.css (Modernist system). */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

section[id],
main[id] {
  scroll-margin-top: 64px;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--color-text);
}
a:hover {
  color: var(--color-accent);
}

::selection {
  background: rgba(236, 48, 19, 0.3);
}

.label {
  margin: 0 0 16px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

/* — fixed column-grid background — */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  max-width: 1240px;
  margin: 0 auto;
  background-image: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--color-text) 5%, transparent) 0 1px,
    transparent 1px 25%
  );
  background-size: 100% 100%;
}

/* — header / nav — */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 2px solid var(--color-divider);
}
.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 24px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  flex: 0 0 auto;
  overflow: hidden;
  max-width: 320px;
  max-height: 40px;
  margin: 0 clamp(12px, 3vw, 24px) 6px 0;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, max-width 0.25s ease, max-height 0.25s ease,
    margin 0.25s ease, visibility 0s;
}
/* While the hero's own name is on screen the brand would just repeat it, so it
   stays collapsed to nothing until the H1 has scrolled under the header — not
   just faded out, but width/height/margin all taken to 0, so no gap is left
   behind in the header and the nav expands to fill the row. The class is added
   by script.js, so the brand stays at its normal size if that never runs. */
.site-header.hero-visible .brand {
  opacity: 0;
  visibility: hidden;
  max-width: 0;
  max-height: 0;
  margin: 0;
  transition: opacity 0.25s ease, max-width 0.25s ease, max-height 0.25s ease,
    margin 0.25s ease, visibility 0s linear 0.25s;
}
@media (prefers-reduced-motion: reduce) {
  .brand,
  .site-header.hero-visible .brand {
    transition: none;
  }
}
.site-nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(10px, 2.4vw, 20px);
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-nav a {
  text-decoration: none;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--color-accent);
}
@media (max-width: 640px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand {
    margin: 0 0 6px 0;
  }
  .site-header.hero-visible .brand {
    margin: 0;
  }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

/* — main / layout — */
main {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

section {
  border-top: 2px solid var(--color-divider);
  padding-top: 20px;
  padding-bottom: 48px;
}
.hero {
  border-top: none;
  padding-top: 48px;
  padding-bottom: 56px;
}

/* — hero — */
.hero-kicker {
  margin: 0 0 24px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.reading-time {
  color: var(--color-accent-700);
}
.hero-name {
  margin: 0 0 14px 0;
  font-size: clamp(28px, 4.6vw, 50px);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
}
.hero-role {
  margin: 0 0 20px 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.hero-lead {
  margin: 0 0 24px 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-actions .btn {
  min-height: 44px;
  padding-inline: 18px;
}

/* — now grid — */
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.now-item p:not(.label) {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* — about — */
.about-copy {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  font-size: 16px;
  line-height: 1.65;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
}
.about-copy p {
  margin: 0;
  text-wrap: pretty;
}

/* — skills — */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  background: var(--color-bg);
  border: 2px solid var(--color-divider);
  margin-top: 4px;
}
.skill-cell {
  background: var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-divider);
  padding: 20px 18px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.skill-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}
.skill-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* — experience / timeline — */
.timeline-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.timeline-inner {
  min-width: 580px;
}
.timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.bar-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.bar-company {
  margin: 0 0 10px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.bar {
  border-top: 2px solid var(--color-divider);
}
.bar-1 {
  height: 40px;
  background: color-mix(in srgb, var(--color-text) 14%, transparent);
}
.bar-2 {
  height: 68px;
  background: color-mix(in srgb, var(--color-text) 22%, transparent);
  border-top-color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.bar-3 {
  height: 96px;
  background: var(--color-accent);
  border-top-color: var(--color-text);
}
.timeline-axis {
  height: 2px;
  background: var(--color-divider);
}
.timeline-years {
  display: flex;
  gap: 2px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.timeline-years > div {
  flex: 1 1 0;
  min-width: 0;
}
.year-current {
  color: var(--color-accent-700);
}

.exp-list {
  display: grid;
  gap: 0;
}
.exp-item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
}
.exp-head h3 {
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.exp-company {
  margin: 0 0 4px 0;
  font-size: 15px;
  color: var(--color-accent-700);
  font-weight: 600;
}
.exp-meta {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.exp-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  grid-column: span 2;
  min-width: 0;
}

/* — projects — */
.embassy-block {
  border: 2px solid var(--color-divider);
  padding: clamp(24px, 4vw, 36px);
  margin-bottom: 36px;
}
.embassy-header {
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-divider);
}
.embassy-header p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.embassy-grid {
  padding-top: clamp(24px, 4vw, 32px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-template-rows: auto 1fr;
  gap: clamp(24px, 3vw, 36px);
  align-items: stretch;
}
.project-card {
  min-width: 0;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  gap: 20px;
}
.project-top {
  min-width: 0;
}
.project-kicker {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.project-title {
  margin: 0 0 6px 0;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.project-subtitle {
  margin: 0 0 4px 0;
  font-size: 13px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.project-link {
  margin: 0 0 20px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-accent-700);
}
.project-link a {
  color: inherit;
}
.project-link-muted {
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.project-desc {
  margin: 0 0 20px 0;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  text-wrap: pretty;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-scope {
  min-width: 0;
  border-top: 2px solid var(--color-divider);
  padding-top: 16px;
}
.scope-label {
  margin: 0 0 12px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.scope-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  font-size: 15px;
  line-height: 1.5;
}
.scope-list li {
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
}
.scope-list li:last-child {
  border-bottom: none;
}

@supports not (grid-template-rows: subgrid) {
  .project-card {
    grid-template-rows: auto auto;
  }
}

.games-note {
  margin: 0 0 20px 0;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  background: var(--color-bg);
  border: 2px solid var(--color-divider);
}
.game-card {
  background: var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-divider);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.game-card h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.game-card p {
  margin: 0;
  flex: 1;
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.game-card .tag-row .btn {
  min-height: 44px;
}
.game-card .btn-secondary {
  padding-inline: 18px;
}
.game-card .btn-ghost {
  padding-inline: 12px;
}

/* — contact — */
.contact {
  border-top: none;
  padding-bottom: 48px;
}
.contact-banner {
  background: var(--color-accent);
  color: var(--color-bg);
  padding: clamp(28px, 6vw, 48px) clamp(20px, 5vw, 36px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(24px, 4vw, 32px);
  align-items: end;
}
.label-inverted {
  color: color-mix(in srgb, var(--color-bg) 80%, transparent);
}
.contact-banner h2 {
  margin: 0;
  font-size: clamp(28px, 6.4vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.contact-links {
  display: grid;
  gap: 2px;
  background: color-mix(in srgb, var(--color-bg) 35%, transparent);
  border: 2px solid color-mix(in srgb, var(--color-bg) 55%, transparent);
}
.contact-links a {
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
  padding: 14px 18px;
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.contact-links a:hover {
  background: var(--color-accent-700);
  color: var(--color-bg);
}
.contact-value {
  opacity: 0.75;
  font-weight: 400;
  font-size: clamp(11px, 3vw, 15px);
  overflow-wrap: anywhere;
}

/* — footer — */
.site-footer {
  border-top: 2px solid var(--color-divider);
  padding: 20px 0 40px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.site-footer p {
  margin: 0;
}

/* — scroll reveal — */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* — print — */
@media print {
  @page {
    margin: 14mm;
  }
  html,
  body {
    background: #fff !important;
  }
  header,
  nav,
  [data-print-hide] {
    display: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  main {
    max-width: none !important;
    padding: 0 !important;
  }
  .contact-banner {
    background: #fff !important;
    color: var(--color-text) !important;
    border: 2px solid var(--color-text) !important;
    padding: 16px !important;
  }
  .contact-links a {
    background: #fff !important;
    color: var(--color-text) !important;
    min-height: 0 !important;
    padding: 6px 0 !important;
  }
  .contact-links {
    border: 0 !important;
    background: none !important;
  }
  .contact-banner h2 {
    font-size: 22px !important;
  }
  section {
    break-inside: avoid;
    page-break-inside: avoid;
    padding-bottom: 18px !important;
  }
  article {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h1 {
    font-size: 34px !important;
  }
  a {
    text-decoration: none !important;
  }
}
