/* Abdallah Gazal — portfolio styles */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0c0e;
  --bg-deep: #060607;
  --surface: #111318;
  --surface-raised: #15171c;
  --surface-2: var(--surface-raised);
  --surface-3: #1a1b21;
  --border: #282b31;
  --line: var(--border);
  --border-soft: #1d2025;
  --line-soft: var(--border-soft);
  --hair: #34353d;

  --text: #f2efe9;
  --text-muted: #9b9da3;
  --muted: var(--text-muted);
  --subtle: var(--text-muted);

  --accent: #c9784c;
  --accent-hover: #dc8959;
  --accent-2: var(--accent-hover);
  --accent-ink: #160b07;

  --display: "Bricolage Grotesque", "Hanken Grotesk", Georgia, serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1180px;
  --radius-lg: 14px;
  --radius-md: 9px;
  --section: 7.6rem;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.62;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.container {
  width: min(var(--container), 90vw);
  margin-inline: auto;
}

main > section {
  padding: var(--section) 0;
}

main > section + section {
  border-top: 1px solid var(--line-soft);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 2500;
  padding: 0.72rem 1rem;
  border-radius: 0 0 8px 8px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Progress line ----------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2300;
  height: 2px;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.cinema-open .scroll-progress {
  opacity: 1;
}

.scroll-progress span {
  display: block;
  width: 100%;
  transform: scaleX(0);
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
}

/* Header ----------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  background: rgba(11, 12, 14, 0.96);
  transition: border-color 0.25s ease;
}

.cinema-open .topbar {
  border-bottom-color: var(--line-soft);
}

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.08;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-role {
  margin-top: 0.32rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--subtle);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -0.5rem;
  height: 2px;
  background: var(--accent);
  transition: right 0.25s cubic-bezier(0.4, 0, 0.1, 1);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  right: 0;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.78rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* Cinematic opening ------------------------------------------------------- */

.cinema-curtain {
  display: none;
}

.cinema-enabled .cinema-curtain {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: block;
  overflow: hidden;
  touch-action: pan-y;
  /* No background here on purpose: the two panels do the covering. A colour on
     this element would stay behind after they part and hide the whole page. */
  background: transparent;
}

.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 50.15%;
  will-change: transform;
  background: var(--bg-deep);
}

.curtain-panel--left {
  left: 0;
  border-right: 1px solid #1b1c20;
}

.curtain-panel--right {
  right: 0;
  border-left: 1px solid #1b1c20;
  background-position: 2rem 0;
}

.curtain-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  will-change: opacity, transform;
}

.curtain-meta {
  position: absolute;
  top: calc(1.55rem + env(safe-area-inset-top, 0px));
  left: calc(1.7rem + env(safe-area-inset-left, 0px));
  color: #8b877f;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.curtain-skip {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top, 0px));
  right: calc(1.45rem + env(safe-area-inset-right, 0px));
  border: 1px solid transparent;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  background: transparent;
  color: #77746d;
  cursor: pointer;
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.curtain-skip:hover,
.curtain-skip:focus-visible {
  color: var(--text);
  border-color: var(--line);
}

.curtain-welcome {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 1050px);
  transform: translate(-50%, -52%);
  text-align: center;
}

.curtain-word {
  display: flex;
  justify-content: center;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.95rem, 13vw, 11rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.curtain-word span {
  display: inline-block;
  transform-origin: 50% 80%;
  will-change: transform, opacity;
}

.curtain-line span {
  display: inline-block;
  will-change: transform, opacity;
}

/* Without the intro running, every letter and word is simply visible. */
.cinema-enabled .curtain-word span,
.cinema-enabled .curtain-line span {
  opacity: 0;
}

.curtain-line {
  margin-top: clamp(2.1rem, 4vw, 3.3rem);
  color: #85817a;
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  letter-spacing: 0.01em;
}

.curtain-prompt {
  position: absolute;
  left: 50%;
  bottom: clamp(1.8rem, 5.5vh, 3.6rem);
  width: min(88vw, 760px);
  transform: translateX(-50%);
  color: #6f6c66;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.curtain-track {
  position: relative;
  width: 100%;
  height: 1px;
  margin-top: 0.9rem;
  background: #2b2c31;
}

.curtain-track::before,
.curtain-track::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #44454c;
}

.curtain-track::before { left: 0; }
.curtain-track::after { right: 0; }

.curtain-track i {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.cinema-open .cinema-curtain {
  pointer-events: none;
  visibility: hidden;
}

/* Hero / stage ------------------------------------------------------------ */

.cinema-intro {
  position: relative;
  padding: 0 !important;
  min-height: calc(100svh - 76px);
}

.cinema-enabled .cinema-intro {
  height: 205svh;
  min-height: 0;
}

.cinema-stage {
  position: relative;
  min-height: calc(100svh - 76px);
  overflow: hidden;
  background: var(--bg);
}

.cinema-enabled .cinema-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  margin-top: -76px;
  padding-top: 76px;
}

.cinema-stage-inner {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.5fr);
  grid-template-rows: 1fr auto;
  gap: 2.8rem 5rem;
  align-items: end;
  padding-top: clamp(7rem, 16vh, 10.5rem);
  padding-bottom: clamp(2.2rem, 6vh, 4rem);
  will-change: transform;
}

.cinema-overline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.45rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.cinema-overline::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent);
}

.cinema-hero-copy h1 {
  max-width: 11ch;
  text-wrap: balance;
  margin-bottom: 1.05rem;
  font-family: var(--display);
  font-size: clamp(4rem, 9.5vw, 8.8rem);
  line-height: 0.9;
  letter-spacing: -0.047em;
  font-weight: 800;
}

.cinema-role {
  margin-bottom: 1.35rem;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.18rem, 2.1vw, 1.62rem);
  letter-spacing: -0.02em;
}

.cinema-role::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 3px;
  margin-top: 1.08rem;
  background: var(--accent);
}

.cinema-lede {
  max-width: 49rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.55vw, 1.14rem);
}

.cinema-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.cinema-rail {
  align-self: end;
  border-left: 1px solid var(--line);
}

.cinema-rail-row {
  display: block;
  padding: 1rem 0 1rem 1.2rem;
  border-top: 1px solid var(--line-soft);
}

.cinema-rail-row:first-child {
  border-top: 0;
}

.cinema-rail-row small {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--subtle);
}

.cinema-rail-row strong {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 500;
}

.cinema-skill-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.cinema-skill-strip span {
  display: inline-flex;
  align-items: center;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

.cinema-skill-strip span:hover {
  color: var(--text);
}

.cinema-skill-strip span + span::before {
  content: "/";
  margin: 0 0.78rem;
  color: var(--accent);
}

/* Shared type ------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}


.eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section-head {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 4rem;
  align-items: end;
  margin-bottom: 3.4rem;
}

.section-head--compact {
  grid-template-columns: 1fr;
  margin-bottom: 2.45rem;
}

.section-head h2,
.contact-card h2 {
  max-width: 18ch;
  text-wrap: balance;
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.036em;
  font-weight: 700;
}

.section-head > p,
.contact-card > div > p:last-child {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Buttons ----------------------------------------------------------------- */

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9px;
  padding: 0.8rem 1.28rem;
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary::after {
  content: "→";
  transition: transform 0.2s ease;
}

.button-primary:hover {
  background: var(--accent-2);
}

.button-primary:hover::after {
  transform: translateX(3px);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--hair);
  background: var(--surface-2);
}

/* Projects ---------------------------------------------------------------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}

.project-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.24s ease;
}

.project-card:hover {
  border-color: #3b3c44;
}

.project-card--featured {
  grid-column: 1 / -1;
}

.project-visual {
  position: relative;
  height: 245px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}

.project-visual--featured {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.project-visual--comparison {
  height: auto;
  aspect-ratio: 16 / 9;
}

.project-visual--comparison img {
  object-position: center center;
}

.project-visual img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.42s cubic-bezier(0.2, 0, 0.1, 1), opacity 0.22s ease;
}

.visual-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  background: #0e0f13;
}

.visual-placeholder span {
  font-family: var(--display);
  color: #5d5d64;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.visual-placeholder small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--subtle);
}

.project-visual.is-empty img {
  display: none;
}

.project-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.72rem;
}

.project-card--featured .project-text {
  padding: 2.2rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-status {
  color: var(--muted);
}

.project-status--live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
}

.project-status--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.project-text h3 {
  font-family: var(--display);
  text-wrap: balance;
  font-size: clamp(1.35rem, 2vw, 1.72rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.project-text > p {
  color: var(--muted);
  font-size: 0.94rem;
}

.project-summary {
  color: var(--text) !important;
  text-wrap: pretty;
  font-size: 1rem !important;
  line-height: 1.57;
}

.project-points {
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-points li {
  padding-left: 0.18rem;
}

.project-points li::marker {
  color: var(--accent);
}

.project-points li + li {
  margin-top: 0.45rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-row span {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.project-card:hover .tag-row span {
  border-color: var(--hair);
}

.project-links {
  margin-top: auto;
  padding-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
}

.project-links a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.project-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.project-links a:hover {
  color: var(--accent-2);
}

.project-links a:hover::after {
  width: 100%;
}

.project-divider {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 0 0.15rem;
}

.project-divider h3 {
  font-weight: 400;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-divider div {
  height: 1px;
  background: var(--line);
}

/* AI4ALL project visual --------------------------------------------------- */

.ai-preview {
  height: 245px;
  padding: 1rem;
  background: var(--bg);
}

.ai-preview-top {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.2rem 0.8rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.ai-preview-top small {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ai-preview-grid {
  height: calc(100% - 36px);
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 0.75rem;
}

.ai-input-panel,
.ai-result-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 0.9rem;
}

.ui-kicker {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fake-input {
  min-height: 78px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: #6f6e73;
  font-size: 0.68rem;
  line-height: 1.4;
}

.fake-button {
  width: fit-content;
  margin-top: 0.65rem;
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.64rem;
  font-weight: 700;
}

.ai-result-panel > strong {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--accent-2);
  font-family: var(--display);
  font-size: 1.24rem;
  letter-spacing: -0.03em;
}

.ai-result-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.34rem 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.64rem;
}

.ai-result-row b {
  color: var(--text);
  font-weight: 600;
}

.agreement-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.agreement-line span {
  padding: 0.25rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.48rem;
}

/* Color model demo -------------------------------------------------------- */

.dual-image .secondary-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 3;
}

.dual-image:hover .secondary-image,
.dual-image:focus-within .secondary-image {
  opacity: 1;
}

.dual-image:hover .primary-image,
.dual-image:focus-within .primary-image {
  opacity: 0;
}

.demo {
  margin: 0.1rem 0 0.15rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.demo-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.demo-heading span,
.demo-heading code {
  font-family: var(--mono);
  font-size: 0.64rem;
}

.demo-heading span {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.demo-heading code {
  color: var(--text);
  letter-spacing: 0.04em;
}

.demo-body {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.demo-swatch {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: #358ceb;
}

.demo-controls {
  display: grid;
  gap: 0.4rem;
}

.demo-control {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 34px;
  gap: 0.5rem;
  align-items: center;
}

.demo-controls label,
.demo-controls output,
.demo-output span,
.demo-output strong {
  font-family: var(--mono);
  font-size: 0.63rem;
}

.demo-controls label,
.demo-output span {
  color: var(--subtle);
}

.demo-controls output {
  color: var(--text);
  text-align: right;
}

.demo input[type="range"] {
  width: 100%;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: #303139;
  cursor: pointer;
}

.demo input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 2px solid #0d0e11;
  background: var(--accent);
}

.demo input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #0d0e11;
  background: var(--accent);
}

.demo-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.demo-output div {
  display: grid;
  gap: 0.18rem;
}

.demo-output strong {
  color: var(--muted);
  font-weight: 500;
  word-break: break-word;
}

/* Experience -------------------------------------------------------------- */

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 3rem;
  padding: 2.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.28s ease;
}

.timeline-item:hover::before {
  width: 74px;
}

.timeline-side {
  padding-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.69rem;
  line-height: 1.55;
}

.timeline-side p {
  color: var(--text);
}

.timeline-side span {
  color: var(--subtle);
}

.timeline-copy h3 {
  margin-bottom: 0.58rem;
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: -0.022em;
  font-weight: 700;
}

.timeline-copy h3 span {
  color: var(--muted);
  font-weight: 500;
}

.timeline-copy > p {
  max-width: 53rem;
  margin-bottom: 0.78rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline-copy ul {
  max-width: 55rem;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-copy li::marker {
  color: var(--accent);
}

.timeline-copy li + li {
  margin-top: 0.4rem;
}

/* About / Skills ---------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.panel {
  position: relative;
  min-height: 0;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.panel:hover {
  border-color: var(--hair);
}


.panel h3 {
  margin-bottom: 0.75rem;
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: -0.026em;
  font-weight: 700;
}

.panel p {
  color: var(--muted);
  max-width: 35rem;
  font-size: 0.95rem;
}

.skills-list {
  border-top: 1px solid var(--line);
}

.skill-group {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 2rem;
  padding: 1.55rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-group p {
  color: var(--muted);
  font-size: 0.98rem;
}

/* Back to top ------------------------------------------------------------- */

.back-to-top {
  position: fixed;
  right: max(1.15rem, calc(env(safe-area-inset-right, 0px) + 0.85rem));
  bottom: max(1.15rem, calc(env(safe-area-inset-bottom, 0px) + 0.85rem));
  z-index: 900;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.68rem 0.86rem 0.68rem 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(17, 19, 24, 0.96);
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.18s ease, border-color 0.18s ease;
}

.back-to-top b {
  color: var(--accent);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: var(--text);
  border-color: var(--hair);
}

/* Contact + footer -------------------------------------------------------- */

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 5rem;
  padding: clamp(1.8rem, 4vw, 3.4rem);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.contact-card h2 {
  margin-bottom: 1rem;
}

.contact-links {
  border-top: 1px solid var(--line);
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.contact-links a:hover {
  color: var(--accent-2);
  padding-left: 0.35rem;
}

.contact-links a span {
  color: var(--subtle);
  text-align: right;
  font-weight: 400;
}

.footer {
  padding: 3rem 0 3.4rem;
  color: var(--subtle);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

/* Reveal ----------------------------------------------------------------- */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js-reveal .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1020px) {
  :root {
    --section: 6.4rem;
  }

  .cinema-stage-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-content: end;
    gap: 2.2rem;
    padding-top: 7.5rem;
  }

  .cinema-hero-copy h1 {
    max-width: 12ch;
  }

  .cinema-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .cinema-rail-row {
    border-top: 0;
    border-left: 1px solid var(--line-soft);
    padding: 1rem 1rem;
  }

  .cinema-rail-row:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .section-head > p {
    max-width: 46rem;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 820px) {
  :root {
    --section: 5.2rem;
  }

  .container {
    width: min(var(--container), 92vw);
  }

  .nav {
    height: 70px;
  }

  .brand-role {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    right: 4vw;
    min-width: 210px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    overflow: hidden;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-links a::after {
    display: none;
  }

  .cinema-intro {
    min-height: calc(100svh - 70px);
    min-height: calc(100dvh - 70px);
  }

  .cinema-enabled .cinema-stage {
    height: 100dvh;
    margin-top: -70px;
    padding-top: 70px;
  }

  .cinema-stage-inner {
    min-height: 100%;
    align-content: center;
    gap: 1.45rem;
    padding-top: max(4.9rem, calc(4.1rem + env(safe-area-inset-top, 0px)));
    padding-bottom: max(1.35rem, calc(0.8rem + env(safe-area-inset-bottom, 0px)));
  }

  .cinema-hero-copy h1 {
    font-size: clamp(3.7rem, 17vw, 6rem);
  }

  .cinema-lede {
    max-width: 38rem;
  }

  .cinema-rail {
    grid-template-columns: 1fr;
  }

  .cinema-rail-row,
  .cinema-rail-row:first-child {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding: 0.75rem 0;
  }

  .cinema-rail-row:first-child {
    border-top: 0;
  }

  .cinema-skill-strip {
    display: none;
  }

  .projects-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .project-card--featured,
  .project-divider {
    grid-column: auto;
  }

  .project-visual {
    height: 230px;
  }

  .project-visual--featured {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .project-text,
  .project-card--featured .project-text {
    padding: 1.45rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 1.8rem 0;
  }

  .timeline-side {
    display: flex;
    gap: 0.8rem;
    align-items: baseline;
  }

  .skill-group {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .ai-preview {
    height: 260px;
  }
}

@media (max-width: 560px) {
  .cinema-enabled .cinema-intro {
    height: 190svh;
    height: 190dvh;
  }

  .curtain-meta {
    top: calc(1.35rem + env(safe-area-inset-top, 0px));
    left: calc(1rem + env(safe-area-inset-left, 0px));
    max-width: 62vw;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
  }

  .curtain-skip {
    top: calc(1.05rem + env(safe-area-inset-top, 0px));
    right: calc(0.85rem + env(safe-area-inset-right, 0px));
  }

  .curtain-welcome {
    top: 48%;
    width: 94vw;
  }

  .curtain-word {
    font-size: clamp(1.95rem, 17vw, 6.8rem);
    letter-spacing: -0.06em;
  }

  .curtain-line {
    margin-top: 2.4rem;
    padding: 0 1.25rem;
    font-size: 1rem;
  }

  .curtain-prompt {
    bottom: 2rem;
    width: 86vw;
    font-size: 0.52rem;
  }

  .cinema-stage-inner {
    gap: 1.05rem;
    padding-top: max(4.35rem, calc(3.65rem + env(safe-area-inset-top, 0px)));
    padding-bottom: max(1rem, calc(0.65rem + env(safe-area-inset-bottom, 0px)));
  }

  .cinema-hero-copy h1 {
    font-size: clamp(3.25rem, 15vw, 5.2rem);
    margin-bottom: 0.8rem;
  }

  .cinema-overline {
    font-size: 0.58rem;
    letter-spacing: 0.13em;
  }

  .cinema-role {
    margin-bottom: 0.88rem;
    font-size: 1.08rem;
  }

  .cinema-role::after {
    margin-top: 0.72rem;
  }

  .cinema-lede {
    font-size: 0.93rem;
    line-height: 1.5;
  }

  .cinema-actions {
    margin-top: 1.2rem;
  }

  .cinema-rail-row,
  .cinema-rail-row:first-child {
    padding-top: 0.54rem;
    padding-bottom: 0.54rem;
  }

  .cinema-rail-row small {
    margin-bottom: 0.16rem;
  }

  .cinema-rail-row strong {
    font-size: 0.8rem;
    line-height: 1.34;
  }

  .cinema-actions {
    width: 100%;
  }

  .button {
    flex: 1;
    padding-inline: 0.9rem;
  }

  .section-head h2,
  .contact-card h2 {
    font-size: clamp(2rem, 10vw, 2.65rem);
  }

  .project-visual,
  .ai-preview {
    height: 210px;
  }

  .project-visual--featured {
    height: auto;
  }

  .ai-preview-grid {
    grid-template-columns: 0.88fr 1.12fr;
    gap: 0.45rem;
  }

  .ai-input-panel,
  .ai-result-panel {
    padding: 0.62rem;
  }

  .fake-input {
    min-height: 58px;
    font-size: 0.58rem;
  }

  .agreement-line span:nth-child(3) {
    display: none;
  }

  .demo-body {
    grid-template-columns: 48px 1fr;
  }

  .demo-swatch {
    width: 48px;
    height: 48px;
  }

  .demo-output {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 1.4rem;
  }

  .back-to-top {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    border-radius: 9px;
  }

  .back-to-top span {
    display: none;
  }

  .contact-links a {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .contact-links a span {
    text-align: left;
  }
}


@media (max-height: 560px) and (min-width: 561px) {
  .cinema-enabled .cinema-intro {
    height: 220dvh;
  }

  .cinema-enabled .cinema-stage {
    height: 100dvh;
  }

  .cinema-stage-inner {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
    grid-template-rows: 1fr;
    align-content: center;
    align-items: center;
    gap: 2rem;
    min-height: 100%;
    padding-top: max(4.8rem, calc(4rem + env(safe-area-inset-top, 0px)));
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom, 0px));
  }

  .cinema-overline {
    margin-bottom: 0.65rem;
    font-size: 0.55rem;
  }

  .cinema-hero-copy h1 {
    margin-bottom: 0.55rem;
    font-size: clamp(3rem, 7vw, 4.6rem);
  }

  .cinema-role {
    margin-bottom: 0.55rem;
    font-size: 0.98rem;
  }

  .cinema-role::after,
  .cinema-skill-strip {
    display: none;
  }

  .cinema-lede {
    max-width: 39rem;
    font-size: 0.82rem;
    line-height: 1.42;
  }

  .cinema-actions {
    margin-top: 0.85rem;
  }

  .button {
    min-height: 40px;
    padding: 0.58rem 0.9rem;
    font-size: 0.82rem;
  }

  .cinema-rail {
    display: block;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .cinema-rail-row,
  .cinema-rail-row:first-child {
    border-left: 0;
    padding: 0.42rem 0 0.42rem 0.85rem;
  }

  .cinema-rail-row + .cinema-rail-row {
    border-top: 1px solid var(--line-soft);
  }

  .cinema-rail-row small {
    margin-bottom: 0.12rem;
  }

  .cinema-rail-row strong {
    font-size: 0.74rem;
    line-height: 1.28;
  }
}

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cinema-curtain {
    display: none !important;
  }

  .cinema-intro,
  .cinema-enabled .cinema-intro {
    height: auto;
    min-height: auto;
  }

  .cinema-stage,
  .cinema-enabled .cinema-stage {
    position: relative;
    height: auto;
    min-height: calc(100svh - 70px);
    margin-top: 0;
    padding-top: 0;
  }

  .js-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Final interaction polish ------------------------------------------------
   Keep motion deliberate on pointer devices and avoid sticky hover states on
   touch screens. */

.contact-links a span {
  overflow-wrap: anywhere;
}

@media (hover: none), (pointer: coarse) {
  .button:hover,
  .project-card:hover,
  .panel:hover {
    transform: none;
  }

  .project-card:not(.project-card--featured):hover .project-visual > img:not(.secondary-image) {
    transform: none;
  }

  .timeline-item:hover::before {
    width: 0;
  }

  .contact-links a:hover {
    padding-left: 0;
  }
}

/* Smaller previews distinguish the supporting Python projects. */
.project-card--compact .project-visual {
  height: 160px;
  aspect-ratio: auto;
}

/* Real product captures: keep the focal content visible at every card width.
   Original image files remain untouched and open at full resolution on click. */
.project-visual--capture {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 280px;
  background: #faf9f7;
}

.project-preview-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  overflow: hidden;
  cursor: zoom-in;
}

.project-preview-link:focus-visible {
  outline-offset: -4px;
}

.project-visual--capture .project-preview-link img {
  position: absolute;
  top: 0;
  max-width: none;
  height: 100%;
  object-fit: contain;
}

.project-visual--resolve .project-preview-link img {
  top: 0;
  width: 100%;
  left: 0;
}

.project-visual--bridge .project-preview-link img {
  top: 0;
  width: 100%;
  left: 0;
}

/* Selected work: retain readable type while reducing preview and spacing weight. */
.project-card:not(.project-card--compact) .project-text {
  padding: 1.25rem;
  gap: 0.65rem;
}

.project-card:not(.project-card--compact) .project-points li + li {
  margin-top: 0.3rem;
}

.project-card:not(.project-card--compact):not(.project-card--featured):not(.project-card--ai) .project-visual:not(.project-visual--capture) {
  height: 210px;
}

.project-card--featured .project-visual--featured {
  height: auto;
  max-height: min(480px, 42vw);
}

.project-card:not(.project-card--compact) .project-visual > img {
  object-fit: contain;
}

.project-card--featured .project-text {
  padding: 1.65rem;
}

.project-card--featured .project-summary,
.project-card--featured .project-points {
  max-width: 78ch;
}

@media (max-width: 820px) {
  .project-visual--capture {
    max-height: 320px;
  }

  .project-card:not(.project-card--compact) .project-text {
    padding: 1.15rem;
  }
}

@media (max-width: 560px) {
  .project-card:not(.project-card--compact) .project-text {
    padding: 1rem;
    gap: 0.6rem;
  }

  .project-card:not(.project-card--compact) .project-points {
    line-height: 1.5;
  }

  .project-card:not(.project-card--compact):not(.project-card--ai) .project-visual {
    max-height: 170px;
  }
}

/* Keep every label inside the shorter AI interface preview. */
.ai-preview {
  height: auto;
  min-height: 210px;
  padding: 0.75rem;
}

.ai-preview-top {
  height: 30px;
  padding-bottom: 0.5rem;
}

.ai-preview-grid {
  height: auto;
  min-height: 154px;
}

.ai-input-panel,
.ai-result-panel {
  padding: 0.6rem;
}

.fake-input {
  min-height: 58px;
}

.ai-result-panel > strong {
  margin-bottom: 0.4rem;
}

.ai-result-row {
  padding-block: 0.2rem;
}

.agreement-line {
  margin-top: 0.3rem;
}

.agreement-line span {
  padding-block: 0.15rem;
}
