@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

.navbar {
    padding-top:40px;
}

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

:root {
  --blue: #00AEEF;
  --dark: #3C3C3C;
  --light-gray: #D9D9D9;
  --white: #FFFFFF;
  --card-shadow-blue: 0px 8px 32px 0px rgba(174, 255, 250, 0.55);
  --card-shadow-purple: 0px 8px 32px 0px rgba(73, 52, 148, 0.35);
  --card-shadow-pink: 0px 8px 32px 0px rgba(239, 181, 243, 0.55);
  --card-shadow-gray: 0px 8px 16px 0px rgba(213, 213, 213, 0.5);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: 'Lato', sans-serif;
  background: #fff;
  color: var(--dark);
  overflow-x: hidden;
}

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

/* ─── LAYOUT ─── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── HEADER ─── */
header {
  padding: 46px 0 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-wrap img {
  width: auto;
  height: 64px;
  display: block;
}

.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #4CAF50;
  border-radius: 50%;
  border: 2px solid #fff;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  white-space: nowrap;
}

.brand-text p {
  font-size: 16px;
  font-weight: 300;
  color: var(--dark);
  line-height: 1.2;
  white-space: nowrap;
}

/* Brand links home on inner pages (on the homepage it's a plain div):
   name turns blue and the avatar grows a little on hover/focus */
a.header-brand { border-radius: 12px; }
a.header-brand .brand-text h1 { transition: color 0.2s; }
a.header-brand:hover .brand-text h1,
a.header-brand:focus-visible .brand-text h1 { color: var(--blue); }
a.header-brand:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; }
@media (prefers-reduced-motion: no-preference) {
  a.header-brand .avatar-wrap { scale: 1; transition: scale 0.2s ease; }
  a.header-brand:hover .avatar-wrap,
  a.header-brand:focus-visible .avatar-wrap { scale: 1.08; }
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  transition: opacity 0.2s;
}

nav a:hover { opacity: 0.7; }
nav a.active,
.nav--spy a:target-current { opacity: 0.4; }

/* Homepage scrollspy: natively highlights the link whose section is in view
   (Chrome/Edge 140+); other browsers use the script in index.html. */
.nav--spy { scroll-target-group: auto; }

/* ─── ABOUT / HERO ─── */
.about-section {
  padding: 64px 0 0;
}

.about-inner {
  display: grid;
  grid-template-columns: 352px 1fr;
  gap: 0;
  align-items: start;
  min-height: 368px;
  position: relative;
}

.about-photo {
  width: 352px;
  height: 368px;
}

.about-photo img {
  width: 352px;
  height: 368px;
  max-width: none;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.about-content {
  padding-top: 4px;
  padding-left:24px;
}

.about-headline {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 20px;
}

.about-headline a {
  color: var(--blue);
  text-decoration: none;
}

.about-body {
  font-size: 18px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.65;
  max-width: 700px;
}

.about-body p + p { margin-top: 18px; }

/* Tools row */
.powered-row {
  margin-top: 40px;
}

.powered-label {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  opacity: 0.3;
  margin-bottom: 12px;
}

.tool-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tool-icons img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  scale: 1; /* identity, so hover doesn't create a new stacking context */
  transition: scale 0.2s;
}

@media (prefers-reduced-motion: no-preference) {
  .tool-icons img:hover { scale: 1.15; }
}

.tool-emoji {
  font-size: 36px;
  line-height: 1;
}

/* ─── CV (about.html) ───
   One row per topic: title on the left, content on the right. */
.cv { padding: 64px 0 40px; }

.cv-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px 48px;
  padding: 32px 0;
  border-top: 1px solid rgba(217, 217, 217, 0.6);
}

.cv-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-list li {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(217, 217, 217, 0.35);
  font-size: 15px;
  color: var(--dark);
}

.cv-list { list-style: none; display: grid; gap: 16px; }
.cv-list strong { display: block; font-size: 17px; font-weight: 700; color: var(--dark); line-height: 1.4; }
.cv-list span { display: block; font-size: 15px; font-weight: 300; color: var(--dark); margin-top: 2px; }
.cv-list--jobs { gap: 28px; }
.cv-list p { font-size: 16px; color: var(--dark); line-height: 1.6; margin-top: 8px; max-width: 720px; }
.cv-list a { color: var(--blue); font-weight: 700; text-decoration: none; }
.cv-list a:hover { color: color-mix(in srgb, var(--blue), #000 12%); }

/* ─── ARTICLES (articles.html) ───
   Uses the CV row layout; each entry is a small thumbnail beside its title. */
.cv--page { padding-top: 64px; }
.cv--page .cv-row:first-child { border-top: 0; }

.article-list { list-style: none; display: grid; gap: 36px; }
.article {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 20px;
  align-items: start;
}
.article-thumb {
  display: block;
  width: 85px;
  aspect-ratio: 64 / 40; /* ~53px tall: the height of the title + description */
  border-radius: 6px;
  overflow: hidden;
  background: var(--light-gray);
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Icon on a white tile (e.g. social network logos) */
.article-thumb--icon {
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #E2E2E2;
}
.article-thumb--icon img { width: 28px; height: 28px; object-fit: contain; }
.article-info h3 { font-size: 17px; font-weight: 700; line-height: 1.4; }
.article-info h3 a { color: var(--dark); text-decoration: none; }
.article-info h3 a:hover,
.article:has(.article-thumb:hover) h3 a { color: var(--blue); }
.article-info p { font-size: 16px; color: var(--dark); line-height: 1.6; margin-top: 4px; max-width: 720px; }

/* ─── PROJECTS SECTION ─── */
.projects-section {
  padding: 80px 0 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.project-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--light-gray);
  height: 360px;
  position: relative;
  cursor: pointer;
  /* Hover lift uses transform; translate is reserved for the scroll reveal,
     so the two never fight over the same property. Identity base value
     keeps the stacking context stable on hover. */
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .project-card:hover { transform: translateY(-6px); }
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card.shadow-blue  { box-shadow: var(--card-shadow-blue); }
.project-card.shadow-purple { box-shadow: var(--card-shadow-purple); }
.project-card.shadow-pink  { box-shadow: var(--card-shadow-pink); }
.project-card.shadow-gray  { box-shadow: var(--card-shadow-gray); }

.card-nda {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-nda-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.05);
}

.card-nda .nda-label {
  position: relative;
  z-index: 2;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1px;
  text-align: center;
}

.card-placeholder {
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-placeholder span {
  font-size: 14px;
  font-weight: 400;
  color: #aaa;
}

/* ═══════ CASE STUDY PAGES (paw-puzzles.html) ═══════ */

/* ─── HERO ─── */
/* Hero gradient: white at the top fading into the project color.
   Variants: hero--blue (default) and hero--purple. */
.hero {
  position: relative;
  background: linear-gradient(to bottom, #fff 13.6%, var(--hero-color, #3fe6fe) 183%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero--blue   { --hero-color: #3fe6fe; }
.hero--purple { --hero-color: #5A42B7; }

.hero-title {
  text-align: center;
  margin-top: 120px;
  position: relative;
  z-index: 2;
}

.hero-title h2 {
  font-size: 40px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
}

.hero-title p {
  font-size: 24px;
  font-weight: 300;
  color: var(--dark);
  margin-top: 6px;
}

/* Three phone mockups */
.hero-phones {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin-top: 40px;
}

.phone-card {
  position: absolute;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0px 4px 8px rgba(38,38,38,0.4);
  bottom: 0;
}

.phone-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-left  { width: 265px; height: 574px; left: calc(50% - 304px - 132px); }
.phone-center{ width: 325px; height: 700px; left: 50%; transform: translateX(-50%); bottom: 0; }
.phone-right { width: 265px; height: 574px; right: calc(50% - 304px - 132px); }

/* Three desktop screens: a large one in front, two smaller ones peeking out
   behind it. The hero's bottom edge clips them all, like a mask.
   Usage: <div class="hero-phones hero-screens"><div class="hero-screens-stage">
   with three .hero-screen images inside. */
.hero-phones.hero-screens {
  width: calc(100% - 32px);
  max-width: 1024px; /* scales all three screens together */
  height: auto;
  /* Same hero height as Paw Puzzles (its 1440×615 header at up to 1120px wide);
     extra space goes above the screens, which stay anchored to the bottom */
  min-height: min(478px, 42.7vw);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-screens-stage { position: relative; }

.hero-screen--center {
  position: relative;
  z-index: 1;
  display: block;
  width: 68.75%;
  margin-inline: auto;
  translate: 0 16px; /* pushed down; the bottom 16px is hidden by the hero */
}

.hero-screen--left,
.hero-screen--right {
  position: absolute;
  top: 20%;
  height: calc(80% + 16px); /* reach the hero's bottom edge, like the center screen */
  width: 50%;
  object-fit: cover;
  object-position: top;
}
.hero-screen--left  { left: 0; }
.hero-screen--right { right: 0; }

/* Hero with a single piece of art (e.g. fashion-match.html): full-size art in a
   box as tall as the other heroes' image area (Paw Puzzles: 1440×615 header at up
   to 1120px wide). The art overflows the box and the hero's bottom edge masks it,
   like the Braspag Dash screens. */
.hero-phones.hero-art { height: min(478px, 42.7vw); }
.hero-art img { display: block; width: 100%; height: auto; translate: 0 -64px; } /* nudged up; the box (and hero height) stays the same */

/* ─── SECTION BASE ─── */
section { padding: 60px 0; }

.section-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 24px;
}

.section-title.light { color: #fff; }

.section-subtitle {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.section-subtitle.light { color: #fff; }

.body-text {
  font-size: 18px;
  font-weight: 400;
  color: var(--dark);
  line-height: 1.65;
}

.body-text.light { color: #fff; }

.body-text p + p { margin-top: 14px; }

/* Links inside paragraphs and captions: bold, no underline, site blue
   (same as the headline and footer links) */
.body-text a,
.caption a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.body-text a:hover,
.caption a:hover { color: color-mix(in srgb, var(--blue), #000 12%); }

/* ─── OVERVIEW + ROLE ─── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.role {
    margin-left: 128px;
}

.role-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.role-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.role-info p { font-size: 14px; font-weight: 300; color: var(--dark); line-height: 1.6; }
.role-info strong { font-size: 16px; font-weight: 700; display: block; margin-bottom: 4px; }

/* ─── PROBLEM ─── */
.problem-band {
  background: #43789e;
  padding: 40px 0;
}

.problem-band .section-title { color: #fff; margin-bottom: 16px; }

.problem-band .body-text { color: #fff; }

/* ─── COLOR BAND (generic full-width colored section) ───
   Set the color per section: <section class="color-band" style="--band-color:#281D51"> */
.color-band {
  background: var(--band-color, var(--dark));
  /* 7px less than the 60px bottom: the section title's line box adds ~7px of
     space above the letters, so this makes the *visible* gaps equal. */
  padding-top: 53px;
}
.color-band .section-title,
.color-band .section-subtitle,
.color-band .body-text { color: #fff; }

/* ─── DESIGN PROCESS ─── */
.process-image {
  width: 100%;
  max-width: 878px;
  height: auto;
  margin: 40px auto 0;
}

/* ─── BENCHMARK ─── */
.benchmark-band {
  background: rgba(217,217,217,0.2);
  padding: 60px 0;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.benchmark-grid ul {
  padding-left: 22px;
  margin-top: 14px;
}

.benchmark-grid li { margin-bottom: 14px; }

.caption {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: #000;
  opacity: 0.7;
  margin-top: 8px;
  text-align: center;
}

/* ─── WIREFRAMES ─── */
.wireframe-section { padding: 60px 0; }

.wireframe-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}



.wf-column--center { justify-self: center; }


/* Image slot — shows a gray placeholder only while it has no image */
.wf-image {
  width: fit-content;
  max-width: 100%;
  height: 312px;
  border-radius: 8px;
  overflow: hidden;
}

.wf-image:not(:has(img)) {
  width: 100%;
  background: var(--light-gray);
}

.wf-image img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left top;
}

.stories-row {
    padding-top: 40px;
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 48px;
  align-items: start;
}

.wireframe-phone img {
  border-radius: 8px;
  width: auto;
  height: auto;
}

/* ─── COMPONENT LIST ───
   Rows of a component image beside its name and description (braspag-dash.html). */
.component-list {
  display: grid;
  gap: 80px;
  margin-top: 32px;
}
.component-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
  --reveal-x: -40px; /* scroll reveal slides in from the image's side */
  --reveal-y: 0;
}
.component-row img { width: 100%; height: auto; }

/* Every other row mirrors: description left, image right */
.component-row:nth-child(even) {
  grid-template-columns: 2fr 3fr;
  --reveal-x: 40px;
}
.component-row:nth-child(even) img { order: 2; }
.component-info h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.component-info p {
  font-size: 18px;
  color: var(--dark);
  line-height: 1.65;
}

/* ─── SCREEN GRID ───
   Rows of same-sized phone screens. Set the columns per grid with style="--cols: 4".
   Add .screen-grid--wireframe for gray-bordered lo-fi screens. */
.screen-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 32px 24px;
  margin-top: 8px;
}
.screen-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
.screen-grid--wireframe img {
  border: 4px solid #888;
  box-shadow: 0 8px 8px rgba(233, 151, 210, 0.4);
}

/* ─── DELIVERABLES (icon + label list) ─── */
.deliverables {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 48px;
  margin-top: 16px;
}
.deliverables li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 140px;
  text-align: center;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--dark);
}
.deliverables img { height: 72px; width: auto; }

/* ─── FINAL MOCKUPS ─── */
.mockups-band {
  background: #3f434a;
  padding: 60px 0;
}

.mockup-phones {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 24px;
}

.mockup-phone {
  width: 293px;
  height: 633px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0px 6px 12px rgba(38,38,38,0.5);
  flex-shrink: 0;
}

.mockup-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── UNITY ─── */
.unity-section { padding: 60px 0; }

/* Text + portrait video side by side: text takes the space, video a phone-width column.
   --unity-media-width: 333px → a 9:16 video shows at 333×592. */
.unity-row {
  --unity-media-width: 333px;
  display: grid;
  grid-template-columns: 1fr var(--unity-media-width);
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}

.unity-row.reverse {
  grid-template-columns: var(--unity-media-width) 1fr;
}

.unity-row.reverse .unity-text { order: 2; }
.unity-row.reverse .unity-placeholder,
.unity-row.reverse .unity-media { order: 1; }

.unity-media { max-width: var(--unity-media-width); } /* stays phone-sized when columns stack on mobile */

.unity-placeholder {
  background: var(--light-gray);
  border-radius: 16px;
  height: 409px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unity-placeholder span {
  font-size: 14px;
  color: #aaa;
}

/* ─── IMAGE CAPTION (title + description label for an image) ───
   <div class="image-caption"> <strong>Title</strong> <span>Description</span> </div>
   Dark text by default; add image-caption--light on dark backgrounds. */
.image-caption {
  margin: 12px 0;
  color: var(--dark);
  font-size: 14px;
  opacity: 0.7;
}
.image-caption:first-child { margin-top: 0; } /* label above an image */
.image-caption strong { display: block; font-weight: 700; }
.image-caption span   { font-weight: 300; }
.image-caption--dark  { color: var(--dark); }
.image-caption--light { color: #BBB5D3; }
.image-caption--center { text-align: center; }

/* ─── IMAGE SHADOW (generic drop shadow for content images) ─── */
/* Defaults below; override per image with CSS variables, e.g.
   style="--image-shadow: 0 8px 24px #251952; --image-radius: 16px" */
.image-shadow {
  border-radius: var(--image-radius, 8px);
  box-shadow: var(--image-shadow, 0 4px 8px rgba(38, 38, 38, 0.1)); /* #262626 @ 10% */
}

/* Centers a block image narrower than its container */
.image-center { margin-inline: auto; }

/* Vertical gallery of full-width images (e.g. component sheets, screens) */
.image-stack {
  display: grid;
  gap: 40px;
  justify-items: center;
  margin-top: 32px;
}

/* ─── CONTENT VIDEO (full-width video, e.g. animations) ─── */
/* Cap a low-resolution video at its native width with style="max-width: 812px" */
.content-video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto; /* centers the video when it's capped below the content width */
  border-radius: 8px;
  background: var(--light-gray); /* visible until the first frame loads */
}

/* ─── IMAGE PLACEHOLDER (generic slot for images not added yet) ─── */
.image-placeholder {
  background: var(--light-gray);
  border-radius: 8px;
  min-height: 312px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #aaa;
}

/* ─── THANKS ─── */
.thanks-section {
  padding: 60px 0 20px;
  text-align: center;
}

.thanks-section h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

.thanks-section p {
  font-size: 16px;
  font-weight: 300;
  margin-top: 4px;
}

.thanks-section a { color: var(--blue); font-weight: 700; font-size: 18px; text-decoration: none; }

/* Other projects: smaller versions of the homepage cards */
.more-projects {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
}
.project-card--mini {
  display: block;
  height: auto;
  aspect-ratio: 544 / 360;
  border-radius: 12px;
}

/* As a CV row (About and Articles pages): title on the left, cards on the right */
.cv--more { padding-top: 32px; }            /* ~104px from the section above */
.cv--more .cv-row { border-top: 0; }
.cv-subtitle { font-size: 15px; font-weight: 300; color: var(--dark); margin-top: 4px; }
.more-projects--row { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: start; margin-top: 0; }

/* ─── DIVIDER ─── */
.divider {
  height: 1px;
  background: var(--light-gray);
  opacity: 0.5;
  margin-bottom: 40px;
}

/* ─── FOOTER ─── */
footer {
  padding: 40px 0 60px;
}

.footer-inner {
  text-align: center;
}

.footer-headline {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.footer-sub {
  font-size: 14px;
  font-weight: 300;
  color: var(--dark);
  margin-bottom: 28px;
}

.footer-sub a {
  color: var(--blue);
  font-weight: 400;
  text-decoration: none;
}

.footer-sub a:hover { text-decoration: underline; }

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  translate: 0; /* identity, so hover doesn't create a new stacking context */
  transition: translate 0.2s, opacity 0.2s;
  opacity: 0.85;
}

.social-row a:hover { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .social-row a:hover { translate: 0 -3px; }
}

.social-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* ─── ANIMATIONS ─── */
/* All motion is opt-in: with "reduce motion" on, every element renders
   in its final, visible state and nothing slides or scales. */
@keyframes fadeUp {
  from { opacity: 0; translate: 0 28px; }
}

@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp 0.65s ease both; }
  .fade-up:nth-child(1) { animation-delay: 0.05s; }
  .fade-up:nth-child(2) { animation-delay: 0.15s; }
  .fade-up:nth-child(3) { animation-delay: 0.25s; }
  .fade-up:nth-child(4) { animation-delay: 0.35s; }
}

/* Scroll reveals (.reveal on case studies, .card-reveal on the homepage).
   Content is visible by default; it's only hidden when motion is allowed
   and scripting is on, so it can never get stuck invisible without JS. */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  /* Native: fade/slide in tied to scroll position, no JS */
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    /* Slides up by default; set --reveal-x / --reveal-y on an element to
       change the direction (e.g. .component-row slides in from the side) */
    @keyframes reveal-in {
      from { opacity: 0; translate: var(--reveal-x, 0) var(--reveal-y, 28px); }
    }

    .reveal,
    .card-reveal {
      animation: reveal-in linear both;
      /* Longhands after the shorthand so it doesn't reset them */
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }

  /* Fallback: hidden until the page script adds .visible */
  @supports not ((animation-timeline: view()) and (animation-range: entry)) {
    .reveal,
    .card-reveal {
      opacity: 0;
      translate: var(--reveal-x, 0) var(--reveal-y, 28px);
      transition: opacity 0.55s ease, translate 0.55s ease;
    }

    /* Keep the project card's own hover transition alongside the reveal */
    .card-reveal {
      transition: opacity 0.55s ease, translate 0.55s ease,
                  transform 0.3s ease, box-shadow 0.3s ease;
    }

    .reveal.visible,
    .card-reveal.visible {
      opacity: 1;
      translate: 0;
    }
  }
}

/* ─── PAGE TRANSITIONS ─── */
/* Cross-fade between pages; the project card morphs into the case study hero
   (matching view-transition-name on both pages). Unsupported browsers
   (e.g. Firefox) navigate normally. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.project-card,
.hero { view-transition-class: project; }

::view-transition-group(*.project) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

/* Profile photo: the photo on Work and the 3D avatar on About sit in the same
   spot, so navigating between the two flips it like a card. The old picture
   turns away, then the new one turns in. */
.about-photo img { view-transition-name: profile-photo; }

::view-transition-group(profile-photo) { animation-duration: 0.6s; }
::view-transition-old(profile-photo) {
  animation: photo-flip-out 0.3s ease-in forwards;
}
::view-transition-new(profile-photo) {
  animation: photo-flip-in 0.3s 0.3s ease-out backwards;
}
@keyframes photo-flip-out {
  from { transform: perspective(1200px) rotateY(0); }
  to   { transform: perspective(1200px) rotateY(90deg); }
}
@keyframes photo-flip-in {
  from { transform: perspective(1200px) rotateY(-90deg); }
  to   { transform: perspective(1200px) rotateY(0); }
}
/* Only one side has a photo (e.g. About → Articles): no flip, just fade out
   or in with the rest of the page */
::view-transition-old(profile-photo):only-child {
  animation: photo-fade 0.25s ease-in forwards;
}
::view-transition-new(profile-photo):only-child {
  animation: photo-fade 0.25s ease-out reverse backwards;
}
@keyframes photo-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ─── BACK TO TOP ───
   Floating button, shown once the page has scrolled one screen height.
   Markup: <a href="#top" class="back-to-top" style="--accent: #00AEEF; --accent-contrast: #003D5C" …>
   (target: <header id="top" tabindex="-1">). --accent is the page's color
   (default --dark); --accent-contrast is the arrow color (default white) and
   must reach 3:1 against --accent and its hover shade.
   The page script toggles .scrolled on <html>. */
.back-to-top {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 44px; /* Apple's minimum tap target */
  height: 44px;
  border-radius: 50%;
  background: var(--accent, var(--dark));
  color: var(--accent-contrast, #fff);
  box-shadow: 0 4px 12px rgba(38, 38, 38, 0.25);
  /* Hidden until the page is scrolled */
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s ease, translate 0.3s ease, background-color 0.2s;
}

.back-to-top:hover { background: color-mix(in srgb, var(--accent, var(--dark)), #000 12%); }
.back-to-top:focus-visible { outline: 3px solid var(--accent, var(--dark)); outline-offset: 3px; }
.back-to-top svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .back-to-top { translate: 0 12px; } /* slides up as it appears */
}

html.scrolled .back-to-top { visibility: visible; opacity: 1; translate: 0; }

/* Invisible marker one screen height down; the button shows once it scrolls past */
.back-to-top-sentinel {
  position: absolute;
  top: 100vh;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Without JavaScript, just keep it visible */
@media (scripting: none) {
  .back-to-top { visibility: visible; opacity: 1; translate: 0; }
}

/* ─── LIGHTBOX (js/lightbox.js) ───
   Images shown smaller than their real size open full screen on tap. */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 20, 20, 0.97); /* near-solid, so the page doesn't show through */
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(20, 20, 20, 0.6); }
.lightbox-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  place-items: center;
  padding: max(56px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 80px);
  border-radius: 6px;
  cursor: zoom-in;
}
.lightbox.is-zoomed .lightbox-stage { place-items: start; }
.lightbox.is-zoomed .lightbox-img {
  max-width: none;
  max-height: none;
  width: var(--zoom-width);
  cursor: zoom-out;
}
.lightbox-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open], .lightbox[open]::backdrop { animation: lightbox-in 0.2s ease; }
  @keyframes lightbox-in { from { opacity: 0; } }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr;
  }
  .about-photo {
    display: none;
  }
  .about-content { padding-left: 0; } /* line up with the name and nav */
  /* Shorter gaps between sections on phones (60px → 40px) */
  section,
  .benchmark-band,
  .mockups-band,
  .wireframe-section,
  .unity-section { padding-block: 40px; }
  .color-band { padding-top: 33px; }   /* keeps the visible gap equal, see .color-band */
  .problem-band { padding-block: 32px; }
  .thanks-section { padding-top: 40px; }
  /* About page: show the photo above the text, full width */
  .about-section--page .about-photo { display: block; width: 100%; height: auto; margin-bottom: 28px; }
  .about-section--page .about-photo img { width: 100%; height: auto; aspect-ratio: 352 / 368; object-fit: cover; }
  /* Tools: all icons share one row, shrinking to fit (never above 40px) */
  .tool-icons { flex-wrap: nowrap; gap: 12px; }
  .tool-icons img { flex: 1 1 0; min-width: 0; max-width: 40px; width: auto; height: auto; aspect-ratio: 1; }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  /* 1. Nav: links move to their own row under the name instead of hiding */
  .header-inner { flex-wrap: wrap; row-gap: 20px; }
  nav { width: 100%; gap: 28px; }

  /* 2. Project cards keep the thumbnails' shape (544×360) so nothing is cropped */
  .project-card { height: auto; aspect-ratio: 544 / 360; }

  /* case study pages */
  .overview-grid, .benchmark-grid, .unity-row, .unity-row.reverse, .wireframe-columns, .stories-row { grid-template-columns: 1fr; }
  /* 3. Heroes: tighter title with side margins, and bigger art. The art is
     wider than the screen and centered, so the hero's overflow trims its
     sides and the middle phone/screen gets most of the width. */
  .hero-title { margin-top: 64px; padding-inline: 20px; }
  .hero-title h2 { font-size: 32px; }
  .hero-title p { font-size: 18px; }
  .hero-phones { width: 150%; max-width: none; margin-top: 28px; }
  .hero-phones > img { display: block; width: 100%; height: auto; }
  .hero-phones.hero-screens { width: 140%; max-width: none; }
  .hero-phones.hero-art { width: 100%; }
  .hero-art img { translate: 0 0; } /* the desktop nudge would cover the subtitle */

  /* 4. Role card: drop the desktop indent so it lines up with the Overview */
  .role { margin-left: 0; }
  .phone-left, .phone-right { display: none; }
  .phone-center { width: 240px; height: 520px; }
  .mockup-phones { flex-wrap: wrap; }
  .screen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .cv-row { grid-template-columns: 1fr; }
  /* Other projects: a swipeable carousel instead of a stack. Cards are 78% wide
     so the next one peeks in; the row runs edge to edge and snaps per card.
     Vertical padding leaves room for the cards' glow (overflow would clip it). */
  .more-projects,
  .more-projects--row {
    display: flex;
    justify-content: flex-start; /* centered overflow would hide the first card off-screen */
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 20px;
    padding: 12px 20px 32px;
    margin-bottom: -20px;
    scrollbar-width: none;
  }
  .more-projects::-webkit-scrollbar { display: none; }
  .more-projects--row { margin-inline: -20px; } /* bleed past the container's side padding */
  .more-projects li { flex: 0 0 78%; scroll-snap-align: start; }
  /* Stacked on phones: image first, and slide up instead of sideways
     so nothing pokes past the screen edge */
  .component-row,
  .component-row:nth-child(even) { grid-template-columns: 1fr; gap: 20px; --reveal-x: 0; --reveal-y: 28px; }
  .component-row:nth-child(even) img { order: 0; }
}
