/* ==========================================================================
   Jevaughn Octable — portfolio styles
   Theme: black + emerald + silver. Obsidian and charcoal backgrounds so photos
   and color stand out like lights on a plant floor; emerald for buttons, links
   and selected items; mint for glowing numbers; champagne gold only for small
   markers (heading slashes, bullets, labels). Faint engineering line art as watermarks.
   To change the look site-wide, edit the variables in :root.
   ========================================================================== */

:root {
  /* Surfaces: shades of black, darkest first */
  --bg: #101114;          /* page background */
  --bg-2: #14161A;        /* alternate sections */
  --panel: #191C22;       /* cards */
  --panel-2: #22262E;     /* raised elements, tags */
  --line: #292F38;        /* borders */
  --line-2: #3A424E;      /* stronger borders */

  /* Text */
  --heading: #F5F6F8;
  --text: #D9DCE1;
  --muted: #A7B0BC;

  /* Accents */
  --accent: #16A36A;      /* emerald: buttons, links, selected items */
  --accent-hover: #65D6A0;  /* mint: hover and glowing numbers */
  --mint: #65D6A0;
  --accent-ink: #04120B;  /* text on emerald */
  --accent-soft: rgba(22, 163, 106, .12);
  --hot: #D6AD68;         /* champagne gold: small markers only */
  --hot-soft: rgba(214, 173, 104, .14);
  --glow: 0 0 0 1px rgba(22, 163, 106, .45), 0 18px 50px rgba(22, 163, 106, .16);

  /* Light "paper" colors, used only inside diagrams and drawing panels */
  --navy: #1B2A4A;
  --steel: #E4E9EF;

  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Manrope", "Segoe UI", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --r: 12px;
  --r-sm: 6px;

  --grid-fine: rgba(22, 163, 106, .035);
  --grid-major: rgba(22, 163, 106, .07);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body { margin: 0; font-family: var(--body); font-size: 1.125rem; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mint); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--display); color: var(--heading); line-height: 1.12; margin: 0 0 .5em; }
h3 { font-size: 1.125rem; font-weight: 700; font-stretch: 105%; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
.container { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.icon { width: 1em; height: 1em; flex: none; }
.icon-lg { width: 2rem; height: 2rem; }

/* Blueprint grid, used on hero and impact bands */
.hero, .impact {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; justify-content: center;
  padding: .85rem 1.35rem; border-radius: var(--r-sm); border: 1.5px solid transparent;
  font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.btn-sm { padding: .5rem .9rem; font-size: .9rem; }
.btn-gold { background: var(--accent); color: var(--accent-ink); }              /* primary */
.btn-gold:hover { background: var(--accent-hover); color: var(--accent-ink); box-shadow: 0 0 28px rgba(22, 163, 106, .45); }
.btn-navy { background: var(--panel-2); color: var(--heading); border-color: var(--line-2); }
.btn-navy:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline-light { border-color: var(--line-2); color: var(--heading); }
.btn-outline-light:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn.is-disabled { opacity: .5; cursor: default; }
.btn.is-disabled:hover { color: inherit; border-color: var(--line-2); box-shadow: none; }

/* ---------- Header / navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(16, 17, 20, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand-mark { width: 10px; height: 26px; background: var(--hot); transform: skewX(-20deg); box-shadow: 0 0 14px rgba(214, 173, 104, .5); }
.brand-name { font: 700 1.15rem/1 var(--display); font-stretch: 112%; letter-spacing: .01em; }
.nav-panel { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a { display: block; padding: 8px 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.02rem; border-radius: var(--r-sm); }
.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--heading); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav-actions { display: flex; gap: 10px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); color: var(--heading); border-radius: var(--r-sm); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle .icon { width: 20px; height: 20px; }
.nav-toggle .icon-close, .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.has-menu { position: relative; }
.menu-head { display: flex; align-items: center; }
.menu-head a { padding-right: 4px; }
.menu-toggle { background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px 6px; border-radius: var(--r-sm); display: inline-flex; }
.menu-toggle .icon { width: 12px; height: 12px; transition: transform .2s ease; }
.menu-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.submenu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px; list-style: none;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.submenu::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; }
.submenu a { color: var(--heading); padding: 10px 14px; font-weight: 600; }
.submenu a:hover { background: var(--accent-soft); color: var(--accent); }
.has-menu.open .submenu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 1121px) {
  .has-menu:hover .submenu, .has-menu:focus-within .submenu { opacity: 1; visibility: visible; transform: none; }
}
@media (max-width: 1120px) {
  .nav-toggle { display: inline-flex; }
  .nav-panel {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 16px; padding: 16px var(--gutter) 24px;
    background: var(--bg-2); border-bottom: 1px solid var(--line); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav-panel.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links > li { border-bottom: 1px solid var(--line); }
  .nav-links a { padding: 14px 4px; font-size: 1.05rem; }
  .nav-links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
  .menu-head { justify-content: space-between; }
  .menu-toggle { padding: 12px; }
  .submenu { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px 12px; min-width: 0; }
  .submenu a { color: var(--text); font-weight: 500; }
  .has-menu.open .submenu { display: block; }
  .nav-actions .btn { flex: 1; }
}

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(56px, 7.5vw, 100px) 0; background: var(--bg); }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head-split { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section-head-split > div { max-width: 700px; }
.lede { font-size: 1.25rem; color: var(--muted); margin: 0; }
.heading { display: flex; align-items: center; gap: 16px; font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; font-stretch: 108%; letter-spacing: -.01em; }
.heading .slash { flex: none; width: 12px; height: .95em; background: var(--hot); transform: skewX(-20deg); box-shadow: 0 0 16px rgba(214, 173, 104, .35); }
.heading-light { color: var(--heading); }
.mini-h { font-size: 1rem; font-stretch: 100%; color: var(--heading); margin: 28px 0 12px; }

/* Faint engineering line art behind a section */
.wm { position: relative; isolation: isolate; overflow: clip; }
.wm::before { content: ""; position: absolute; z-index: -1; pointer-events: none; opacity: .055; background: center / contain no-repeat; }
.wm-gear::before { width: 560px; height: 560px; right: -180px; top: -140px; background-image: url("../img/watermarks/gear.svg"); }
.wm-drawing::before { width: 620px; height: 443px; left: -140px; bottom: -70px; background-image: url("../img/watermarks/drawing.svg"); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li { font-size: .92rem; font-weight: 500; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.tags-lg li { font-size: .95rem; padding: 6px 14px; }
.bullets { list-style: none; display: grid; gap: 10px; }
.bullets li { position: relative; padding-left: 24px; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; background: var(--hot); transform: skewX(-20deg); }

/* ---------- Photo shapes (one per page) ---------- */
.cut-photo { position: relative; margin: 0; isolation: isolate; }
.cut-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.cut-photo::before, .cut-photo::after { content: ""; position: absolute; pointer-events: none; }
/* Home hero: machined plate with chamfered corners and a glowing outline */
.shape-chamfer { --cut: 46px; }
.shape-chamfer img, .shape-chamfer::before, .shape-chamfer::after {
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.shape-chamfer::before { inset: -12px; background: var(--accent); z-index: 0; filter: drop-shadow(0 0 18px rgba(22, 163, 106, .55)); }
.shape-chamfer::after { inset: -10px; background: var(--bg); z-index: 0; }
/* Home "What I bring": hexagon, like a hex nut */
.shape-hex img, .shape-hex::before, .shape-hex::after { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.shape-hex::before { inset: -14px; background: var(--hot); z-index: 0; }
.shape-hex::after { inset: -11px; background: var(--bg-2); z-index: 0; }
/* Skills: circle with a dashed ring, like a gauge or dial */
.shape-dial img { border-radius: 50%; box-shadow: 0 0 60px rgba(22, 163, 106, .18); }
.shape-dial::before { inset: -14px; border: 3px dashed var(--accent); border-radius: 50%; z-index: 0; }
.shape-dial::after { inset: -26px; border: 1px solid var(--line-2); border-radius: 50%; z-index: 0; }
/* Experience: photo on top of an offset frame, like stacked drawing sheets */
.shape-offset img { height: auto; border-radius: 4px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5); }
.shape-offset::before { top: 18px; left: 18px; right: -18px; bottom: -18px; border: 2px solid var(--hot); border-radius: 4px; z-index: 0; }

/* ---------- Hero (homepage) ---------- */
.hero { position: relative; isolation: isolate; overflow: clip; color: var(--text); padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 8vw, 104px); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px 420px at 78% 42%, rgba(22, 163, 106, .16), transparent 70%), radial-gradient(500px 360px at 8% 100%, rgba(214, 173, 104, .08), transparent 70%); }
.hero-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.gear { position: absolute; opacity: .07; }
.gear-a { width: 620px; right: -140px; top: -120px; animation: spin 120s linear infinite; }
.gear-b { width: 300px; right: 370px; bottom: -110px; animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-role { font-family: var(--display); font-weight: 600; font-stretch: 112%; color: var(--mint); font-size: 1.05rem; margin-bottom: 18px; letter-spacing: .01em; text-shadow: 0 0 18px rgba(22, 163, 106, .45); }
.hero h1 { color: var(--heading); font-size: clamp(3.1rem, 7.4vw, 6.6rem); font-weight: 800; font-stretch: 115%; line-height: .93; letter-spacing: -.015em; margin: 6px 0 28px; }
.hero-intro { font-size: 1.15rem; max-width: 60ch; color: var(--text); margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { position: relative; padding: 12px; }
.hero-photo { aspect-ratio: 4 / 5; }
.headshot {
  position: absolute; z-index: 2; left: -28px; bottom: 40px; width: clamp(130px, 13vw, 176px); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden; border: 5px solid var(--bg); box-shadow: 0 0 0 2px var(--hot), 0 18px 40px rgba(0, 0, 0, .55);
  background: var(--panel-2); display: grid; place-items: center; align-content: center; text-align: center;
}
.headshot img { width: 100%; height: 100%; object-fit: cover; }
.headshot.is-placeholder { background: repeating-linear-gradient(-45deg, #1E2228 0 10px, #252A32 10px 20px); }
.hs-initials { font: 800 2.4rem/1 var(--display); font-stretch: 115%; color: var(--hot); display: block; }
.hs-note { display: block; font-size: .68rem; line-height: 1.3; color: var(--text); margin-top: 6px; }

/* ---------- Capabilities ---------- */
.spec-row { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.spec-row li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px; transition: border-color .2s ease, box-shadow .2s ease; }
.spec-row li:hover { border-color: rgba(22, 163, 106, .5); box-shadow: var(--glow); }
.spec-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(22, 163, 106, .35); border-radius: var(--r-sm); margin-bottom: 18px; font-size: 1.4rem; }
.spec-row p { color: var(--muted); font-size: 1.04rem; margin: 0; }

/* ---------- What I bring ---------- */
.bring-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.bring-photo { aspect-ratio: .87; }
.bring-list { list-style: none; display: grid; gap: 22px; margin-top: 12px; }
.bring-list li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: start; }
.bring-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-2); color: var(--accent); font-size: 1.2rem; background: var(--panel); }
.bring-list h3 { margin: 2px 0 4px; }
.bring-list p { margin: 0; color: var(--muted); }

/* ---------- Key impact ---------- */
.impact { position: relative; padding: clamp(64px, 9vw, 112px) 0; color: var(--text); border-block: 1px solid var(--line); background-color: var(--bg-2); }
.impact .lede { color: var(--muted); }
.metric-grid { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 28px; }
.metric { border-top: 2px solid var(--line-2); padding-top: 18px; position: relative; }
.metric::before { content: ""; position: absolute; top: -2px; left: 0; width: 44px; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.metric-value { font: 800 clamp(2rem, 3.2vw, 2.75rem)/1 var(--display); font-stretch: 108%; color: var(--mint); margin: 0 0 12px; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(22, 163, 106, .35); }
.metric-value .unit { font-size: .55em; font-weight: 700; margin-left: .12em; }
.metric-label { color: var(--heading); font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.metric-context { color: var(--text); font-size: 1rem; margin: 0 0 8px; line-height: 1.4; }
.metric-source { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.35; }

/* ---------- Project cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.project-card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.project-card:hover, .project-card:focus-within { border-color: rgba(22, 163, 106, .55); box-shadow: var(--glow); }
.project-card[hidden] { display: none; }
.pc-media { position: relative; aspect-ratio: 16 / 10; background: var(--panel-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pc-media::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(16, 17, 20, .35)); pointer-events: none; }
.pc-media.is-contain { background: #F4F6F8; }
.pc-media.is-contain::after { display: none; }
.pc-media.is-contain img, .pc-media .cpm-diagram { object-fit: contain; padding: 46px 16px 14px; width: 100%; height: 100%; }
.project-card:hover .pc-media img { transform: scale(1.04); }
.pc-media .badge { position: absolute; top: 12px; left: 12px; z-index: 1; }
.pc-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.pc-area { font-size: .9rem; color: var(--hot); font-weight: 600; margin: 0 0 6px; }
.pc-body h3 { font-size: 1.3rem; margin: 0 0 10px; }
.pc-body h3 a { color: var(--heading); text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pc-summary { color: var(--muted); font-size: 1.04rem; }
.pc-body .tags { margin-top: auto; padding-top: 6px; }
.pc-link { margin-top: 18px; font-weight: 600; color: var(--mint); display: inline-flex; align-items: center; gap: 8px; }
.pc-link::after { content: ""; width: 28px; height: 2px; background: var(--accent); transition: width .2s ease; }
.project-card:hover .pc-link::after { width: 44px; }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; line-height: 1.3; backdrop-filter: blur(6px); }
.badge-done { background: rgba(16, 60, 36, .85); color: #8EE6AE; border: 1px solid rgba(142, 230, 174, .35); }
.badge-design { background: rgba(20, 40, 70, .85); color: #9CC3FF; border: 1px solid rgba(156, 195, 255, .35); }
.badge-proposed { background: rgba(70, 40, 10, .85); color: #FFC18A; border: 1px solid rgba(255, 193, 138, .35); }
.badge-dev { background: rgba(50, 30, 80, .85); color: #CDB6FF; border: 1px solid rgba(205, 182, 255, .35); }
.badge-ongoing { background: rgba(10, 60, 66, .85); color: #8FE6F2; border: 1px solid rgba(143, 230, 242, .35); }

/* ---------- Featured projects carousel ---------- */
.carousel { position: relative; }
.carousel-stage { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px var(--gutter) 24px; }
.carousel-slide { flex: 0 0 min(420px, 82vw); scroll-snap-align: center; }
.carousel-slide .project-card { height: 100%; }
.carousel-controls { display: none; }
.js .carousel-stage { display: grid; justify-items: center; align-items: stretch; overflow: hidden; overflow: clip; padding: 24px 0 36px; touch-action: pan-y; user-select: none; cursor: grab; }
.js .carousel-stage.is-dragging { cursor: grabbing; }
.js .carousel-slide {
  grid-area: 1 / 1; width: min(440px, 80vw);
  transform: translateX(calc(var(--off, 0) * var(--gap-x, 84%))) scale(var(--s, 1));
  opacity: var(--o, 1); z-index: var(--z, 1);
  transition: transform .6s cubic-bezier(.22, .7, .2, 1), opacity .6s ease, filter .6s ease;
}
.js .carousel-slide:not(.is-active) { filter: saturate(.5) brightness(.75); cursor: pointer; }
.js .carousel-slide:not(.is-active) .project-card { pointer-events: none; }
.js .carousel-slide.is-active .project-card { border-color: rgba(22, 163, 106, .6); box-shadow: var(--glow); }
.carousel-slide img { -webkit-user-drag: none; }
.js .carousel-controls { display: flex; align-items: center; justify-content: center; gap: 20px; }
.carousel-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--heading); display: grid; place-items: center; cursor: pointer; transition: border-color .15s ease, color .15s ease, box-shadow .2s ease; }
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 20px rgba(22, 163, 106, .3); }
.carousel-btn .icon { width: 18px; height: 18px; }
.carousel-dots { display: flex; gap: 10px; }
.carousel-dot { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: var(--line-2); cursor: pointer; transition: width .3s ease, background-color .3s ease; }
.carousel-dot[aria-current="true"] { width: 30px; background: var(--accent); box-shadow: 0 0 10px rgba(22, 163, 106, .6); }

/* ---------- Key takeaways ---------- */
.take-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.take-statement { font: 800 clamp(1.9rem, 3.4vw, 2.8rem)/1.12 var(--display); font-stretch: 110%; color: var(--heading); margin: 24px 0 0; padding-left: 28px; border-left: 4px solid var(--hot); }
.checklist { list-style: none; display: grid; gap: 18px; }
.checklist li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; font-size: 1.08rem; }
.checklist .icon { width: 36px; height: 36px; padding: 9px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(22, 163, 106, .35); }

/* ---------- Contact ---------- */
.contact { position: relative; background: var(--bg); color: var(--text); padding: clamp(80px, 11vw, 140px) 0; overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); }
.contact-bg { position: absolute; inset: 0 0 0 auto; width: 58%; z-index: -1;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(16, 17, 20, .72) 40%, rgba(16, 17, 20, .2) 100%), url("../img/photos/modern-plant-floor.jpg") center / cover no-repeat; }
.contact-inner { max-width: 760px; margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); }
.contact h2 { color: var(--heading); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; font-stretch: 110%; }
.contact p { font-size: 1.15rem; max-width: 56ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 24px; }
.contact-email { display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--muted); font-size: 1.05rem; }
.contact-email span { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Footer (with a thin hazard stripe on top) ---------- */
.site-footer { background: #0B0C0E; color: var(--muted); font-size: .95rem; position: relative; }
.site-footer::before { content: ""; display: block; height: 6px; background: repeating-linear-gradient(-45deg, var(--hot) 0 14px, #0B0C0E 14px 28px); opacity: .9; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 2fr 1fr; gap: 32px; padding: 48px 0 32px; align-items: start; }
.footer-name { font: 700 1.2rem/1.2 var(--display); font-stretch: 112%; color: var(--heading); margin-bottom: 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a, .footer-contact a, .footer-base a { color: var(--text); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover, .footer-base a:hover { color: var(--accent); }
.footer-contact { display: grid; gap: 10px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 10px; }
.footer-base { display: flex; justify-content: space-between; padding: 18px 0 28px; border-top: 1px solid var(--line); font-size: .85rem; }
.footer-base p { margin: 0; }

/* ---------- Inner page header: dimmed photo, grid, factory skyline ---------- */
.page-hero, .case-hero { position: relative; isolation: isolate; overflow: clip; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line); }
.page-hero { padding: clamp(64px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }
.ph-bg { position: absolute; inset: 0 0 0 30%; z-index: -2; background: center / cover no-repeat; opacity: .5; filter: saturate(.85) blur(1px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%); }
.page-hero::before, .case-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--grid-major) 1px, transparent 1px) -1px -1px / 120px 120px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) -1px -1px / 120px 120px,
    linear-gradient(180deg, rgba(16, 17, 20, .1), rgba(16, 17, 20, .85)); }
.page-hero::after, .case-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: -1; pointer-events: none;
  background: url("../img/watermarks/factory.svg") bottom center / auto 100% repeat-x; opacity: .06; }
.page-hero h1 { color: var(--heading); font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800; font-stretch: 115%; letter-spacing: -.015em; margin-bottom: 14px; display: flex; align-items: center; gap: 20px; }
.page-hero h1::before { content: ""; flex: none; width: 16px; height: .85em; background: var(--hot); transform: skewX(-20deg); box-shadow: 0 0 18px rgba(214, 173, 104, .4); }
.page-hero p { font-size: 1.2rem; max-width: 62ch; margin: 0; }
.page-404 .hero-cta { margin-top: 28px; }

/* ---------- Education ---------- */
.edu-list { display: grid; gap: clamp(56px, 8vw, 96px); }
.edu { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.edu-year { font: 800 3rem/1 var(--display); font-stretch: 115%; color: var(--mint); text-shadow: 0 0 24px rgba(22, 163, 106, .35); position: sticky; top: calc(var(--header-h) + 24px); }
.edu-photo { position: relative; margin: 0; background: var(--panel); padding: 14px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 44px rgba(0, 0, 0, .45); align-self: start; }
.edu-photo::after { content: ""; position: absolute; inset: 7px; border: 1.5px solid rgba(22, 163, 106, .55); border-radius: 4px; pointer-events: none; }
.edu-photo img { width: 100%; height: auto; display: block; border-radius: 3px; }
.edu-photo.is-sticky { position: sticky; top: calc(var(--header-h) + 32px); }
.edu-school { font-weight: 600; color: var(--hot); margin: 0 0 6px; }
.edu-body h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; font-stretch: 108%; margin-bottom: 6px; }
.edu-focus { font-size: 1.12rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 24px 0 8px; }
.facts div { padding: 14px 16px 14px 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.facts dt { font-size: .9rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font: 700 1.25rem/1.25 var(--display); color: var(--heading); }

/* ---------- Skills ---------- */
.tabbar { position: sticky; top: var(--header-h); z-index: 40; background: rgba(20, 22, 26, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabbar-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 18px 18px 16px; background: none; border: 0; border-bottom: 3px solid transparent; font: 600 1rem/1.2 var(--body); color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--heading); }
.tab[aria-selected="true"] { color: var(--heading); border-bottom-color: var(--accent); }
.tab-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); font-size: .82rem; color: var(--text); }
.tab[aria-selected="true"] .tab-num { background: var(--accent); color: var(--accent-ink); }
.js .skill-panel[hidden] { display: none; }
.skill-intro { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.skill-intro .heading { justify-content: center; }
.skill-panel { position: relative; isolation: isolate; overflow: clip; padding-top: clamp(40px, 5vw, 64px); }
.skill-bg { position: absolute; inset: 0 0 auto; height: min(640px, 90%); z-index: -1; background: center / cover no-repeat; opacity: .16; filter: saturate(.6) brightness(.8);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%); }
.skill-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 20%, rgba(16,17,20,.55), rgba(16,17,20,.92) 70%); pointer-events: none; }
.skill-groups { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.skill-group { grid-column: span 2; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 0 0 var(--r) var(--r); padding: 24px; transition: box-shadow .2s ease; }
.skill-group:hover { box-shadow: 0 18px 44px rgba(0, 0, 0, .4), 0 -6px 24px -12px rgba(22, 163, 106, .5); }
.skill-group:nth-child(4) { grid-column: 2 / span 2; }
.skill-group h3 { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; margin-bottom: 16px; }
.sg-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; background: var(--accent-soft); color: var(--accent); border-radius: var(--r-sm); font-size: 1.05rem; flex: none; }
.skill-group ul { list-style: none; display: grid; gap: 9px; }
.skill-group li { padding-left: 18px; position: relative; font-size: 1.05rem; line-height: 1.45; }
.skill-group li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--hot); transform: skewX(-20deg); }

/* ---------- Experience ---------- */
.timeline-wrap { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.timeline { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.timeline::before { content: ""; position: absolute; left: 10%; right: 10%; top: 27px; height: 2px; background: linear-gradient(90deg, var(--line-2), var(--accent)); box-shadow: 0 0 10px rgba(22, 163, 106, .3); }
.timeline a { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; padding: 0 8px; color: var(--text); }
.tl-dot { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--panel-2); color: var(--accent); font-size: 1.2rem; border: 4px solid var(--bg-2); box-shadow: 0 0 0 1.5px var(--line-2); margin-bottom: 14px; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.timeline a:hover .tl-dot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 1.5px var(--accent), 0 0 24px rgba(22, 163, 106, .5); }
.tl-dates { font-size: .85rem; color: var(--hot); font-weight: 600; }
.tl-title { font: 700 1.05rem/1.25 var(--display); color: var(--heading); margin: 4px 0 2px; }
.tl-org { font-size: .97rem; color: var(--muted); }

.role-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.role-flip .role-photo { order: 2; }
.role-photo { position: sticky; top: calc(var(--header-h) + 32px); }
.role-meta { display: flex; flex-wrap: wrap; margin: 0 0 10px; font-size: .95rem; color: var(--muted); }
.role-meta span + span { padding-left: 14px; margin-left: 14px; border-left: 1px solid var(--line-2); }
.role-meta span:first-child { color: var(--hot); font-weight: 600; }
.role-summary { font-size: 1.15rem; color: var(--text); }
.role-highlights { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 8px; }
.role-highlights li { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--r-sm); padding: 14px 18px; display: flex; flex-direction: column; min-width: 150px; max-width: 260px; }
.role-highlights strong { font: 800 1.8rem/1.1 var(--display); font-stretch: 108%; color: var(--mint); text-shadow: 0 0 18px rgba(22, 163, 106, .3); }
.role-highlights span { font-size: .95rem; line-height: 1.35; margin-top: 4px; color: var(--text); }

/* ---------- Case study ---------- */
.case-hero { padding: 36px 0 clamp(48px, 7vw, 80px); }
.crumbs { display: flex; gap: 10px; font-size: .92rem; margin-bottom: 36px; color: var(--muted); }
.case-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.case-head h1 { color: var(--heading); font-size: clamp(2.3rem, 5vw, 4rem); font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; margin: 16px 0; }
.case-lede { font-size: 1.18rem; max-width: 60ch; margin: 0; }
.case-metrics { list-style: none; display: grid; gap: 14px; }
.case-metrics li { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 16px 20px; display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; background: rgba(25, 28, 34, .78); backdrop-filter: blur(6px); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.case-metrics strong { font: 800 2.2rem/1 var(--display); font-stretch: 108%; color: var(--mint); grid-row: span 2; text-shadow: 0 0 22px rgba(22, 163, 106, .35); }
.case-metrics span { color: var(--heading); line-height: 1.35; }
.note { font-style: normal; font-size: .75rem; font-weight: 600; justify-self: start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; }
.note-target { background: var(--hot-soft); color: #E8C88E; border: 1px solid rgba(214, 173, 104, .45); }
.note-model { background: rgba(156, 195, 255, .12); color: #9CC3FF; border: 1px solid rgba(156, 195, 255, .35); }

.case-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); padding: clamp(48px, 7vw, 88px) 0; align-items: start; }
.case-aside { position: sticky; top: calc(var(--header-h) + 24px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.case-aside dl { margin: 0; display: grid; gap: 18px; }
.case-aside dt { font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.case-aside dd { margin: 0; font-weight: 600; color: var(--heading); }
.case-aside .tags { margin-top: 4px; }
.case-body { max-width: 860px; }
.case-sec { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.case-sec:last-child { border-bottom: 0; margin-bottom: 0; }
.case-sec h2 { display: flex; align-items: center; gap: 14px; font-size: 1.6rem; font-weight: 800; font-stretch: 106%; }
.sec-num { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(22, 163, 106, .4); font-size: 1rem; border-radius: var(--r-sm); flex: none; }
.objective { font-size: 1.25rem; color: var(--heading); font-weight: 500; border-left: 4px solid var(--hot); padding-left: 20px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 20px 18px; position: relative; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 16px; right: 18px; font: 800 1.1rem/1 var(--display); color: var(--line-2); }
.steps h3 { margin-bottom: 6px; padding-right: 32px; }
.steps p { margin: 0; color: var(--muted); font-size: 1.04rem; }
.visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.visual { margin: 0; }
.visual:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.visual.diagram { grid-column: 1 / -1; }
.visual.diagram + .visual:last-child { grid-column: 1 / -1; }
.visual figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rep-tag { font-size: .72rem; background: var(--panel-2); color: var(--muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.zoom { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #F4F6F8; cursor: zoom-in; }
.zoom img { width: 100%; max-height: 480px; object-fit: contain; }
.visual.is-representative .zoom { background: var(--panel); }
.visual.is-representative .zoom img { object-fit: cover; aspect-ratio: 16 / 10; }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(16, 17, 20, .8); color: var(--heading); border-radius: var(--r-sm); opacity: 0; transition: opacity .2s ease; }
.zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; }
.placeholder-box { border: 2px dashed var(--line-2); border-radius: var(--r); background: repeating-linear-gradient(-45deg, #15171B 0 12px, #191C22 12px 24px); min-height: 220px; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--muted); }
.placeholder-box .icon { margin: 0 auto 10px; color: var(--line-2); }
.ph-title { font-weight: 600; color: var(--heading); margin: 0 0 4px; }
.ph-hint { margin: 0; font-size: .92rem; max-width: 40ch; }
/* Diagrams sit on a light "drawing sheet" so their line colors read like a printed drawing */
.diagram { background: #F4F6F8; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.diagram figcaption { color: #5A6474; }
.cpm-diagram { width: 100%; height: auto; display: block; }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipeline li { position: relative; background: var(--steel); border-radius: var(--r-sm); padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.pipeline li:first-child, .pipeline li:last-child { background: var(--navy); }
.pipeline li:first-child *, .pipeline li:last-child * { color: #fff; }
.pipeline strong { font: 700 1rem/1.2 var(--display); color: var(--navy); }
.pipeline span { font-size: .85rem; line-height: 1.35; color: #5A6474; }
.pipeline li + li::before { content: ""; position: absolute; left: -9px; top: 50%; border-left: 7px solid var(--hot); border-top: 6px solid transparent; border-bottom: 6px solid transparent; transform: translateY(-50%); }
.result-row { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.result-row li { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--r-sm); padding: 16px 20px; display: flex; flex-direction: column; min-width: 180px; }
.result-row strong { font: 800 2rem/1.1 var(--display); color: var(--mint); }
.result-row span { color: var(--text); font-size: .92rem; }
.case-nav { background: var(--bg-2); border-top: 1px solid var(--line); }
.case-nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; padding: 28px 0; }
.case-nav-link { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--heading); font: 700 1.05rem/1.3 var(--display); }
.case-nav-link:hover { color: var(--accent); }
.case-nav-link small { display: block; font: 500 .82rem/1.4 var(--body); color: var(--muted); }
.case-nav-link.is-next { justify-self: end; text-align: right; }
.case-nav-link .icon { color: var(--accent); width: 18px; height: 18px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter { font: 500 .95rem/1.2 var(--body); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 20px rgba(22, 163, 106, .3); }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(5, 7, 10, .9); }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--r-sm); background: #fff; margin: 0 auto; }
.lightbox-caption { color: var(--text); text-align: center; margin: 12px 0 0; }
.lightbox-close { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--heading); color: var(--bg); display: grid; place-items: center; cursor: pointer; }

.count { font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-group, .skill-group:nth-child(4) { grid-column: auto; }
  .skill-group:nth-child(5) { grid-column: 1 / -1; }
  .edu { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .edu-year { display: none; }
  .edu-photo.is-sticky { position: relative; top: 0; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline li + li::before { display: none; }
  .gear-b { display: none; }
}
@media (max-width: 860px) {
  .hero-grid, .bring-grid, .take-grid, .skill-intro, .role-grid, .case-head, .case-layout, .edu { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 460px; }
  .bring-photo { width: min(100%, 340px); margin-inline: auto; }
  .shape-offset::before { top: 10px; left: 10px; right: -10px; bottom: -10px; }
  .role-flip .role-photo { order: 0; }
  .role-photo { position: relative; top: 0; }
  .case-aside { position: relative; top: 0; }
  .timeline { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .timeline::before { left: 27px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; background: linear-gradient(180deg, var(--line-2), var(--accent)); }
  .timeline a { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; text-align: left; align-items: center; }
  .tl-dot { margin: 0; grid-row: span 3; }
  .contact-bg { width: 100%; opacity: .45; }
  .ph-bg { inset: 0; opacity: .3; }
  .case-nav-inner { grid-template-columns: 1fr 1fr; }
  .case-nav-inner .btn { grid-column: 1 / -1; grid-row: 2; }
  .gear-a { width: 420px; right: -180px; top: -80px; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; }
  .spec-row { grid-template-columns: minmax(0, 1fr); }
  .project-grid, .skill-groups, .steps, .visual-grid, .pipeline { grid-template-columns: minmax(0, 1fr); }
  .skill-group:nth-child(5) { grid-column: auto; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero-cta .btn, .contact-actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-value { white-space: normal; }
  .headshot { left: 0; }
  .js .carousel-slide { --gap-x: 94%; }
  .wm::before { opacity: .04; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Background images and photo watermarks ---------- */
/* Home hero: "Industrial Engineering" word cloud, kept dark so the writing stays readable */
.hero-words { position: absolute; left: 1%; top: 8%; width: min(64%, 860px); opacity: .08; }
/* Graphics (like the Six Sigma banner) are shown whole instead of cropped */
.ph-bg.is-graphic { inset: 10% 3% 14% 36%; background-size: contain; background-position: right center; filter: none; opacity: .32; }
/* Photo watermarks: grey, very faint, soft edges, so they never compete with the text */
.wm-photo-gears::before, .wm-photo-ie::before, .wm-chart::before {
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent); mask-image: radial-gradient(closest-side, #000 35%, transparent);
}
.wm-photo-gears::before { width: 820px; height: 547px; right: -160px; top: 50%; transform: translateY(-50%); background-image: url("../img/backgrounds/gears-process.jpg"); background-size: cover; opacity: .07; filter: grayscale(1); }
.wm-photo-ie::before { width: 720px; height: 404px; right: -120px; bottom: -40px; background-image: url("../img/backgrounds/gears-ie.jpg"); background-size: cover; opacity: .08; filter: grayscale(1); }
.wm-chart::before { width: 620px; height: 465px; right: -80px; bottom: 0; background-image: url("../img/backgrounds/production-types.png"); opacity: .09; filter: saturate(.5); }
/* Bigger headshot circle */
.headshot { width: clamp(190px, 19vw, 270px); left: -52px; bottom: 28px; border-width: 6px; }
@media (max-width: 860px) { .hero-words { width: 90%; opacity: .08; } .ph-bg.is-graphic { inset: 18% 4%; opacity: .18; } }
@media (max-width: 600px) { .headshot { width: 170px; left: 0; bottom: 16px; } }

/* Word-cloud watermark in the empty space under the education photos */
.wm-words::before { width: 400px; height: 214px; left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + 110px)); bottom: 40px; background-image: url("../img/backgrounds/ie-words.png"); opacity: .07; }
@media (max-width: 1100px) { .wm-words::before { left: var(--gutter); } }
@media (max-width: 860px) { .wm-words::before { display: none; } }
