/*
  SELF-HOSTED FONTS — activation steps:
  1. Go to fonts.google.com, download "DM Serif Display" and "DM Sans"
  2. Extract the woff2 files and place them in assets/fonts/:
       DMSerifDisplay-Regular.woff2
       DMSerifDisplay-Italic.woff2
       DMSans[opsz,wght].woff2   (the variable font covers all weights)
  3. Delete the two Google Fonts <link> tags from index.html
  The @font-face rules below are already wired — just add the files.
*/
@font-face {
  font-family: "DM Serif Display";
  src: url("./assets/fonts/DMSerifDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("./assets/fonts/DMSerifDisplay-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("./assets/fonts/DMSans-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --ink: #1a1814;
  --ink-2: #4a4743;
  --ink-3: #8a8784;
  --paper: #f5f2ed;
  --paper-2: #ede9e3;
  --paper-3: #e3dfd8;
  --accent: #2d6a4f;
  --accent-light: #e8f3ee;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --max: 1080px;
  --gap: clamp(1.5rem, 4vw, 3rem);
}

html {
  scroll-behavior: smooth;
}

/* Focus styles — keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 1rem;
}

a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82em;
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  color: var(--accent);
}

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(245, 242, 237, 0.85);
  border-bottom: 1px solid var(--paper-3);
}

nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-links a.active {
  color: var(--ink);
  font-weight: 500;
}

.nav-cv {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--paper-3);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  transition:
    color 0.2s,
    border-color 0.2s;
  white-space: nowrap;
}
.nav-cv:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hamburger button */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
  transform-origin: center;
}

.nav-burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav menu */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background: rgba(245, 242, 237, 0.98);
  border-top: 1px solid var(--paper-3);
  padding: 1rem var(--gap) 1.5rem;
  gap: 0;
}

.nav-mobile-menu.open {
  display: flex;
}

.nav-mobile-menu a {
  font-size: 1rem;
  color: var(--ink-2);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--paper-3);
  transition: color 0.2s;
}

.nav-mobile-menu a:last-child {
  border-bottom: none;
}
.nav-mobile-menu a:hover {
  color: var(--accent);
}

/* Full-width hero wrapper — holds dot grid + cursor glow */
.hero-section {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(
    circle,
    var(--paper-3) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gap) 3.5rem;
  gap: 4rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* Gradient fade from dot grid into the page */
.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--paper));
  pointer-events: none;
  z-index: 0;
}

.hero-label,
.section-num,
.page-kicker,
.cs-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.hero-label {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-label::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc,
.page-intro,
.work-card p,
.about-right p,
.contact-left p,
.cs-body p,
.cs-mini ul li,
.dec-content p,
.result-block p,
.reflection-block p,
.note {
  color: var(--ink-2);
}

.hero-desc {
  font-size: 1rem;
  font-weight: 400;
  max-width: 460px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-actions,
.page-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 5px;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 3px rgba(26, 24, 20, 0.18);
}
.btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.28);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(26, 24, 20, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--paper-3);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-2);
  transform: translateY(-1px);
}
.btn-ghost:active {
  transform: translateY(0);
  background: var(--paper-3);
}

/* Cursor glow is injected into .hero-section by JS */

/* Cursor glow */
.cursor-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(120, 170, 140, 0.13),
    transparent 65%
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Tools ticker */
.tools-ticker {
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--paper-3);
  border-radius: 8px;
  background: var(--paper-2);
  padding: 0.65rem 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 12%,
    black 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 12%,
    black 88%,
    transparent
  );
}
.tools-ticker-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: max-content;
  animation: tickerScroll 22s linear infinite;
}
.tools-ticker-track span {
  font-size: 0.72rem;
  color: var(--ink-2);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.tools-ticker-track .t-dot {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}
@keyframes tickerScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tools-ticker-track {
    animation: none;
  }
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
  min-width: 0;
  margin-top: 2.5rem;
}
.hero-card {
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  will-change: transform;
  transform-style: preserve-3d;
  transition:
    transform 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
.hero-card:hover {
  box-shadow: 0 20px 60px rgba(26, 24, 20, 0.1);
}

.hero-left {
  position: relative;
  z-index: 1;
}

/* Stats block */
.hero-stats-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--paper-3);
}

.hero-stat-item {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-stat-item + .hero-stat-item {
  border-top: 1px solid var(--paper-3);
}

/* Skill cards */
.skill-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.skill-card {
  background: var(--paper);
  border: 1px solid var(--paper-3);
  border-radius: 10px;
  padding: 12px 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.skill-card:hover {
  border-color: var(--ink-3);
  box-shadow: 0 2px 10px rgba(26, 24, 20, 0.06);
}

.skill-icon {
  font-size: 16px;
  color: var(--ink);
  display: block;
  margin-bottom: 7px;
  line-height: 1;
}

.skill-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
}

.skill-desc {
  font-size: 0.65rem;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}

/* Shared small tokens */
.stat-num,
.cs-metric-val,
.rg-val {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1;
}
.stat-num {
  font-size: 2.2rem;
}
.stat-label,
.cs-metric-lab,
.rg-lab,
.wm-lab,
.contact-link-label,
footer p {
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.card-img-placeholder,
.cs-mini,
.avail-card,
.project-nav-card {
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
}

.tool-tag,
.cs-tag {
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  background: var(--paper-3);
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Work tags — dot prefix style (Linear/Raycast) */
.work-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
  text-transform: none;
}

.work-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}

.work-tag-dot.accent {
  background: var(--accent);
}

section,
.about-inner,
.contact-inner,
.cs-hero,
.cs-body,
.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.page-wrap {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--paper-3);
  padding-bottom: 1rem;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.work-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--paper-3);
  border: 3px solid var(--paper-3);
  border-radius: 10px;
  overflow: hidden;
}

.work-card {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px rgba(26, 24, 20, 0.11),
    0 2px 6px rgba(26, 24, 20, 0.06);
  z-index: 1;
}

.card-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem;
  text-align: center;
  min-height: 220px;
  border-bottom: 1.5px solid var(--paper-3);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 1.5px solid var(--paper-3);
  flex-shrink: 0;
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.5s ease;
}

.work-card:hover .card-img {
  transform: scale(1.04);
}

/* Hover overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 20, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.card-overlay span {
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(6px);
  transition: transform 0.35s ease;
}
.work-card:hover .card-overlay {
  opacity: 1;
}
.work-card:hover .card-overlay span {
  transform: translateY(0);
}

/* Featured full-width card */
.work-card-featured {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
}
.work-card-featured .card-img-wrap {
  border-bottom: none;
  border-right: 1.5px solid var(--paper-3);
}
.work-card-featured .card-img {
  aspect-ratio: unset;
  height: 100%;
  min-height: 380px;
  object-position: center;
}
.work-card-featured:hover {
  transform: none;
  box-shadow: 0 8px 32px rgba(26, 24, 20, 0.1);
}
.work-card-featured .work-card-body {
  padding: 2rem 2.25rem;
}
.work-card-featured h3 {
  font-size: 1.65rem;
}

/* Sub-grid: 3 smaller cards */
.work-grid-small {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  background: var(--paper-3);
}

/* Stack metrics vertically inside the 3 smaller cards */
.work-grid-small .work-metric {
  flex-direction: column;
  gap: 0.55rem;
}

/* Project-type kicker above h3 */
.work-kicker {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: -0.1rem;
}

.card-img-placeholder span {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.card-img-hint {
  font-size: 0.7rem !important;
  color: #b6b1ab !important;
  font-family: monospace;
}

.work-card-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.work-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.work-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.work-card-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}
.work-year {
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  line-height: 1;
}
.work-arrow {
  font-size: 1.4rem;
  color: var(--ink-3);
  transition:
    transform 0.2s,
    color 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.work-card:hover .work-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}
.work-card h3 {
  font-size: 1.35rem;
  line-height: 1.25;
}
.work-card p {
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.7;
}
.work-metric {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-3);
}
.wm-val {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--accent);
  display: block;
}
.wm-lab {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 0.1rem;
}

.about-section {
  background: var(--paper-2);
  /* Override the generic section rule — about uses full-width background */
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-inner {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.about-lead {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 1rem;
  font-weight: 400;
  max-width: 540px;
}
.about-p {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 0.85rem;
  max-width: 540px;
}
.about-p:last-child {
  margin-bottom: 0;
}
.about-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.about-currently {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  padding: 0 0.25rem;
  margin-top: -0.25rem;
}
.skill-cards-vertical {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.skill-cards-vertical .skill-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.75rem;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    border-color 0.2s,
    box-shadow 0.2s;
}
.about-right.visible .skill-cards-vertical .skill-card:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}
.about-right.visible .skill-cards-vertical .skill-card:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}
.about-right.visible .skill-cards-vertical .skill-card:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}
.about-right.visible .skill-cards-vertical .skill-card:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}
.about-right.visible .skill-cards-vertical .skill-card:hover {
  transform: translateY(-3px);
  transition-delay: 0s;
  border-color: var(--paper-3);
  box-shadow: 0 8px 24px rgba(26, 24, 20, 0.1);
}
@media (prefers-reduced-motion: reduce) {
  .skill-cards-vertical .skill-card {
    opacity: 1;
    transform: none;
    transition:
      border-color 0.2s,
      box-shadow 0.2s;
  }
}

.skill-cards-vertical .skill-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.skill-cards-vertical .skill-icon {
  font-size: 18px;
  width: auto;
  height: auto;
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.contact-section {
  background: var(--ink);
  padding-top: clamp(4rem, 7vw, 7rem);
  padding-bottom: clamp(4rem, 7vw, 7rem);
  padding-left: 0;
  padding-right: 0;
  max-width: none;
  width: 100%;
}

/* Work subheading */
#work {
  padding-top: 2.5rem;
}
#work .section-header {
  margin-bottom: 0.5rem;
}
.work-subhead {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-3);
  margin-bottom: 2.5rem;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.2s;
  z-index: 200;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent);
}

.contact-wrap {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

.contact-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.contact-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 242, 237, 0.35);
  font-weight: 500;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.contact-kicker::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.contact-heading {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 400;
  color: #f5f2ed;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.contact-desc {
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(245, 242, 237, 0.65);
  line-height: 1.75;
  margin-bottom: 0.6rem;
  max-width: 500px;
}

.contact-trust {
  font-size: 0.82rem;
  color: rgba(245, 242, 237, 0.38);
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.contact-avail {
  width: fit-content;
  margin-bottom: 1.25rem;
}

.contact-cta {
  align-self: flex-start;
  margin-bottom: 2rem;
}

.contact-email-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.75rem;
}

.contact-email-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 242, 237, 0.5);
}

.contact-email-plain {
  font-size: 0.9rem;
  color: rgba(245, 242, 237, 0.95);
  text-decoration: none;
  letter-spacing: 0.01em;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
  text-decoration: underline;
  text-decoration-color: transparent;
  padding: 0.3rem 0;
}
.contact-email-plain:hover {
  text-decoration-color: rgba(245, 242, 237, 0.4);
}
.contact-email-plain:focus-visible {
  outline: 2px solid rgba(245, 242, 237, 0.6);
  outline-offset: 3px;
  border-radius: 2px;
}
.contact-email-wrap:last-child {
  margin-bottom: 0;
}

.contact-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Dark contact buttons */
.contact-section .btn-primary {
  background: var(--accent);
  color: #f5f2ed;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.contact-section .btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 4px 18px rgba(45, 106, 79, 0.45);
  transform: translateY(-1px);
  opacity: 1;
}
.contact-section .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.contact-section .btn-ghost {
  color: rgba(245, 242, 237, 0.7);
  border-color: rgba(245, 242, 237, 0.2);
  background: transparent;
}
.contact-section .btn-ghost:hover {
  border-color: rgba(245, 242, 237, 0.65);
  color: #f5f2ed;
  background: rgba(245, 242, 237, 0.07);
  transform: translateY(-1px);
}
.contact-section .btn-ghost:active {
  transform: translateY(0);
  background: rgba(245, 242, 237, 0.04);
}

.contact-meta {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.avail-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 242, 237, 0.1);
  margin-bottom: 4px;
}

.avail-badge span:last-child {
  font-size: 0.78rem;
  color: #f5f2ed;
  font-weight: 400;
}

/* avail-badge in About section — light version */
.about-right .avail-badge {
  background: rgba(45, 106, 79, 0.08);
  border-color: rgba(45, 106, 79, 0.22);
  width: fit-content;
}
.about-right .avail-badge span:last-child {
  color: var(--accent);
}

.avail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.contact-detail-group {
  border-top: 1px solid rgba(245, 242, 237, 0.1);
}

.contact-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(245, 242, 237, 0.1);
}

.contact-meta-link {
  color: rgba(245, 242, 237, 0.85);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.contact-meta-link:hover {
  color: #f5f2ed;
  text-decoration: underline;
  text-decoration-color: rgba(245, 242, 237, 0.35);
}
.contact-meta-link:focus-visible {
  outline: 2px solid rgba(245, 242, 237, 0.6);
  outline-offset: 3px;
  border-radius: 2px;
}

.contact-detail-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 242, 237, 0.5);
}

.contact-detail-val {
  font-size: 0.88rem;
  color: rgba(245, 242, 237, 0.85);
}

footer {
  background: var(--ink);
  border-top: 1px solid rgba(245, 242, 237, 0.08);
  padding: 1.5rem var(--gap);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
footer p,
footer a {
  color: rgba(245, 242, 237, 0.35);
  font-size: 0.78rem;
  text-decoration: none;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-shrink: 0;
}
.footer-links a {
  transition: color 0.2s;
}
.footer-links a:hover {
  color: rgba(245, 242, 237, 0.75);
}

.page-kicker {
  margin-bottom: 1rem;
}
.page-title {
  max-width: 840px;
  margin-bottom: 1rem;
}
.page-intro {
  max-width: 700px;
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}
.page-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 2rem;
  margin-top: 2rem;
}
.project-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.project-nav-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  position: relative;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.project-nav-card::after {
  content: "↗";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1rem;
  color: var(--ink-3);
  transition:
    color 0.2s,
    transform 0.2s;
}
.project-nav-card:hover {
  border-color: var(--ink-3);
  box-shadow: 0 2px 14px rgba(26, 24, 20, 0.09);
}
.project-nav-card:hover::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.project-nav-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  padding-right: 1.5rem;
}
.project-nav-card p {
  font-size: 0.88rem;
  color: var(--ink-2);
}

.cs-hero {
  padding-top: 6rem;
  padding-bottom: 3rem;
}
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.cs-back:hover {
  color: var(--accent);
}
.cs-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
}
.cs-read-time {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  margin-left: auto;
  white-space: nowrap;
}
.cs-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 1rem;
  max-width: 700px;
}
.cs-subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  max-width: 530px;
  margin-bottom: 2rem;
  line-height: 1.8;
  color: var(--ink-2);
}
.cs-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
  border-top: 1px solid var(--paper-3);
  border-bottom: 1px solid var(--paper-3);
}
.cs-metric {
  padding: 1.5rem 2rem;
  border-right: 1px solid var(--paper-3);
}
.cs-metric:first-child {
  padding-left: 0;
}
.cs-metric:last-child {
  padding-right: 0;
  border-right: none;
}
.cs-metric-val {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.25rem;
}
.cs-body {
  max-width: 780px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.cs-section-label {
  margin-bottom: 0.5rem;
  margin-top: 3rem;
}
.cs-body h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}
.cs-body p {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.callout {
  border-left: 2px solid var(--accent);
  padding: 1rem 1.5rem;
  background: var(--accent-light);
  margin: 1.5rem 0;
}
.callout p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-3);
  margin: 1.5rem 0;
}
.cs-mini {
  padding: 1.5rem;
}
.cs-mini h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}
.cs-mini ul {
  padding-left: 1.1rem;
}
.cs-mini ul li {
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 0.4rem;
}
.decision-block {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--paper-3);
  align-items: flex-start;
}
.decision-block:last-child {
  border-bottom: none;
}
.dec-num {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
  flex-shrink: 0;
  width: 2rem;
}
.dec-content h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.dec-content p {
  font-size: 0.88rem;
  font-weight: 400;
  margin: 0;
}
.img-placeholder {
  background: var(--paper-2);
  border: 1px dashed var(--paper-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 4rem 2rem;
  margin: 1.5rem 0;
  text-align: center;
}
.img-placeholder span {
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* ── Information Architecture ── */
.ia-wrap {
  margin: 1.75rem 0 2rem;
  border: 1px solid var(--paper-3);
  border-radius: 10px;
  overflow: hidden;
}
.ia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--paper-3);
}
.ia-header-title {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
}
.ia-header-count {
  font-size: 0.68rem;
  color: var(--ink-3);
}
.ia-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--paper-3);
}
.ia-card:nth-child(-n + 2) {
  grid-column: span 3;
}
.ia-card:nth-child(n + 3) {
  grid-column: span 2;
}
.ia-card-items.ia-card-items--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 0.35rem 1.5rem;
}
.ia-card {
  background: var(--paper);
  overflow: hidden;
}
.ia-card-label {
  background: var(--accent);
  color: #f5f2ed;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
}
.ia-card-items {
  background: var(--paper);
  padding: 0.65rem 0.75rem;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ia-card-items li {
  font-size: 0.78rem;
  color: var(--ink-2);
  line-height: 1.4;
  padding-left: 0.65rem;
  position: relative;
}
.ia-card-items li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.ia-card-items li span {
  font-size: 0.67rem;
  color: var(--ink-3);
  display: block;
  margin-top: 0.1rem;
}
@media (max-width: 600px) {
  .ia-grid {
    grid-template-columns: 1fr;
  }
  .ia-card:nth-child(-n + 2),
  .ia-card:nth-child(n + 3) {
    grid-column: span 1;
  }
  .ia-card-items.ia-card-items--2col {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}

.case-study-image {
  width: calc(100% + 200px);
  margin: 1.5rem -100px;
  border: 1px solid var(--paper-3);
  background: var(--paper-2);
  overflow: hidden;
}

.case-study-image img {
  width: 100%;
  height: auto;
  display: block;
}
.case-study-image figcaption {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--paper-3);
  background: var(--paper-2);
}
.result-block {
  background: var(--ink);
  color: var(--paper);
  padding: 2.5rem;
  margin: 2rem 0;
  border-radius: 10px;
}
.result-block h3 {
  font-size: 1.5rem;
  color: var(--paper);
  margin-bottom: 1.5rem;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.rg-val {
  font-size: 2rem;
  color: var(--accent);
  display: block;
}
.rg-lab {
  color: rgba(245, 242, 237, 0.5);
}
.result-block p {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(245, 242, 237, 0.7);
  line-height: 1.8;
  margin: 0;
}
.reflection-block {
  background: var(--paper-2);
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  border-left: 2px solid var(--accent);
}
.reflection-block h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.reflection-block p {
  font-size: 0.88rem;
  margin: 0;
}
.cs-note {
  opacity: 0.6;
  font-size: 0.9em;
}

.cs-divider {
  border: none;
  border-top: 1px solid var(--paper-3);
  margin: 2.5rem 0;
}

/* ── Case study progress indicator ── */
.cs-progress {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.cs-progress-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-3);
  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.cs-progress-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

.cs-progress-dot:hover {
  background: var(--ink-3);
  transform: scale(1.3);
}

.cs-progress-dot.active:hover {
  background: var(--accent);
}

.cs-progress-dot::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.cs-progress-dot:hover::after {
  opacity: 1;
}

@media (max-width: 768px) {
  .cs-progress {
    display: none;
  }
}

/* ── User flow diagram (compact timeline) ── */
.flow-compact {
  position: relative;
  margin: 1.75rem 0 2rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--accent);
  opacity: 1;
}

.flow-node {
  display: grid;
  grid-template-columns: 1fr 175px;
  gap: 1.25rem;
  align-items: center;
  padding: 0 0 0 1.1rem;
  position: relative;
}

/* Arrow connector between nodes */
.flow-connector {
  display: grid;
  grid-template-columns: 1fr 175px;
  gap: 1.25rem;
  padding-left: 1.1rem;
}

.flow-connector-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0.1rem 0;
}

.fc-line {
  width: 2px;
  height: 20px;
  background: var(--accent);
  opacity: 0.35;
}

.fc-chevron {
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
}

.flow-legend {
  display: grid;
  grid-template-columns: 1fr 175px;
  gap: 1.25rem;
  padding-left: 1.1rem;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--paper-3);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 500;
}

.flow-legend-pos {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flow-legend-pos::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.flow-legend-neg {
  color: #a03c3c;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.flow-legend-neg::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1.5px dashed rgba(160, 60, 60, 0.6);
}

.flow-node-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--accent-light);
  border: 1px solid rgba(45, 106, 79, 0.15);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
}

.flow-node-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
}

.flow-node-main h4 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--sans);
  margin: 0.1rem 0 0;
  line-height: 1.4;
}

.flow-node-main p {
  font-size: 0.75rem;
  color: var(--ink-2);
  margin: 0.15rem 0 0;
  line-height: 1.5;
}

.flow-node.fn-success .flow-node-main {
  background: var(--accent);
  border-color: var(--accent);
}

.flow-node.fn-success .flow-node-main h4 {
  color: #f5f2ed;
  font-size: 0.95rem;
}

.flow-node.fn-success .flow-node-main p {
  color: rgba(245, 242, 237, 0.75);
}

.flow-node.fn-success::before {
  background: var(--accent);
  border-color: var(--paper);
}

.flow-node-exit {
  border: 1px dashed rgba(160, 60, 60, 0.3);
  background: rgba(160, 60, 60, 0.04);
  border-radius: 7px;
  padding: 0.45rem 0.7rem;
  width: 175px;
  flex-shrink: 0;
  align-self: center;
}

.flow-exit-tag {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a03c3c;
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.flow-node-exit p {
  font-size: 0.7rem;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .flow-node,
  .flow-connector {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .flow-node-exit {
    width: 100%;
  }
  .flow-connector > div:last-child {
    display: none;
  }
}

@media (max-width: 920px) {
  .case-study-image {
    width: 100%;
    margin: 1.5rem 0;
  }
}

/* ── Mobile screens grid ── */
.mobile-screens {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 2rem;
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: 8px;
}

.mobile-screens-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding: 0 1.5rem;
}

.mobile-screens-row img {
  width: 200px;
  flex-shrink: 0;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(26, 24, 20, 0.1);
}

.mobile-screens figcaption {
  text-align: left;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  width: 100%;
}

@media (max-width: 600px) {
  .mobile-screens {
    padding: 1.25rem 1.25rem 1rem;
    gap: 0.75rem;
  }
  .mobile-screens-row {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding: 0.25rem 0.5rem 0.75rem;
    gap: 0.75rem;
    /* hide scrollbar visually */
    scrollbar-width: none;
  }
  .mobile-screens-row::-webkit-scrollbar {
    display: none;
  }
  .mobile-screens-row img {
    width: 75vw;
    max-width: 280px;
    scroll-snap-align: center;
  }
}

.fade-up {
  animation: fadeUp 0.7s ease both;
}
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.22s;
}
.delay-3 {
  animation-delay: 0.34s;
}
.delay-4 {
  animation-delay: 0.46s;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.reveal-d1 {
  transition-delay: 0.15s;
}
.reveal.reveal-d2 {
  transition-delay: 0.3s;
}
.reveal.reveal-d3 {
  transition-delay: 0.45s;
}

@media (max-width: 860px) {
  .project-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* At tablet: all cards go single-column, full content visible */
@media (max-width: 860px) {
  .work-card-featured {
    grid-template-columns: 1fr;
  }
  .work-card-featured .card-img-wrap {
    border-right: none;
    border-bottom: 1.5px solid var(--paper-3);
  }
  .work-card-featured .card-img {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: unset;
  }
  .work-card-featured .work-card-body {
    padding: 1.5rem 1.75rem;
  }
  .work-card-featured h3 {
    font-size: 1.35rem;
  }
  /* 3 small cards: single column, no empty slots */
  .work-grid-small {
    grid-template-columns: 1fr;
  }
  /* Restore horizontal metric layout on full-width mobile cards */
  .work-grid-small .work-metric {
    flex-direction: row;
    gap: 1.25rem;
  }
}

/* At mobile: 3-col sub-grid collapses to 1-col, all content stays visible */
@media (max-width: 600px) {
  .work-grid-small {
    grid-template-columns: 1fr;
  }
  .work-card-body {
    padding: 1.25rem 1.25rem;
    gap: 0.75rem;
  }
  .work-card h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  /* Stack metrics vertically on single-col mobile too */
  .work-grid-small .work-metric {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .hero,
  .about-grid,
  .page-grid {
    grid-template-columns: 1fr;
  }
  .skill-cards-vertical {
    grid-template-columns: 1fr 1fr;
    max-width: 480px;
  }
  .hero {
    padding-top: 4rem;
    min-height: auto;
  }
  .hero-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .skill-cards {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .contact-main {
    padding: 0;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(245, 242, 237, 0.1);
  }
  .contact-meta {
    padding: 0;
  }
  .cs-metrics,
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cs-metrics > *:last-child:nth-child(odd),
  .result-grid > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .cs-two-col {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .work-metric,
  .hero-actions,
  .page-actions {
    flex-wrap: wrap;
  }
  .skill-cards {
    grid-template-columns: 1fr 1fr;
  }
  .hero-stats-block {
    gap: 0;
  }
  .cs-metrics,
  .result-grid {
    grid-template-columns: 1fr;
  }
  .cs-metric {
    border-right: none;
    border-bottom: 1px solid var(--paper-3);
    padding-left: 0;
  }
  .cs-metric:last-child {
    border-bottom: none;
  }
  .result-block {
    padding: 1.75rem;
  }
}
