/* Design tokens */
:root {
  /* Primary */
  --primary: #167b89;
  --primary-dark: #0f5f6b;
  --primary-light: #1b95a5;
  /* Secondary: deep teal-ink for dark sections and text */
  --ink: #0b262d;
  --ink-2: #123640;
  /* Tertiary: warm amber for highlights */
  --accent: #f4a84f;
  /* Neutrals */
  --paper: #f1f7f7;
  --paper-2: #e1eeee;
  --white: #ffffff;
  --slate: #4d6770;
  --line: #c8dcdd;
  --green: #3ecf8e;
  --radius: 10px;
  --max: 1160px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 3rem);
  background: rgba(241, 247, 247, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: var(--primary); color: #fff; border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
}

.brand-avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--primary);
}

.nav { display: flex; align-items: center; gap: 1.4rem; font-size: .95rem; }
.nav a:not(.btn) { text-decoration: none; color: var(--slate); font-weight: 500; transition: color .2s; }
.nav a:not(.btn):hover { color: var(--primary); }

/* Hamburger: hidden on desktop, icon only on mobile */
.nav-toggle {
  display: none; position: relative; width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1.5px solid var(--line); border-radius: 6px; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.nav-toggle:hover { border-color: var(--primary); background: rgba(22, 123, 137, .06); }
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .2s, top .25s;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* ---------- Button system ----------
   .btn-primary   filled, primary color
   .btn-secondary quiet, no border
   .btn-outline   bordered
   .btn-sm        compact size
   Arrow icon is added automatically:
   internal / mailto links point down-right, external links up-right, downloads down. */
.btn {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5l10 10M7 15h8V7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .95rem 1.35rem; border: 1.5px solid transparent; border-radius: 6px;
  font-family: var(--font-body); font-size: .82rem; font-weight: 600; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer; background: transparent; color: var(--ink);
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.btn::after {
  content: ""; flex: none; width: 1.1em; height: 1.1em; background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat;
  transition: transform .2s;
}
.btn[target="_blank"] {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 15L15 5M7 5h8v8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.btn[download] {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3v12M5 10l5 5 5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translate(2px, 2px); }
.btn[target="_blank"]:hover::after { transform: translate(2px, -2px); }
.btn[download]:hover::after { transform: translateY(3px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 10px 20px -10px rgba(22, 123, 137, .7); }

.btn-secondary { padding-inline: 1rem; color: var(--ink); }
.btn-secondary:hover { color: var(--primary); background: rgba(22, 123, 137, .08); }

.btn-outline { border-color: #9cbfc4; color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(22, 123, 137, .06); }

.btn-sm { padding: .7rem 1rem; font-size: .74rem; }
.btn-sm.btn-secondary { padding-inline: .75rem; }

/* Buttons on dark sections */
.section-dark .btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); box-shadow: 0 10px 22px -10px rgba(27, 149, 165, .8); }
.section-dark .btn-secondary { color: #fff; }
.section-dark .btn-secondary:hover { color: var(--accent); background: rgba(255, 255, 255, .08); }
.section-dark .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .35); }
.section-dark .btn-outline:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .1); }

.nav .btn-primary, .nav .btn-primary:hover { color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.chips li {
  padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); font-size: .88rem; font-weight: 500;
}
.chips-small { margin-top: 1rem; }
.chips-small li { font-size: .8rem; padding: .2rem .65rem; }

.kicker { font-size: .9rem; font-weight: 600; color: var(--primary); margin-bottom: .75rem; }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 3rem); }
.section > * { max-width: var(--max); margin-inline: auto; }
.section-tint { background: var(--paper-2); }
.section-dark { background: var(--ink); color: #e6f2f3; }
.section-dark .kicker { color: var(--accent); }
.section-dark .sub { color: #a8c8ce; }
.section-head { margin-bottom: 3rem; }
.section-head h2, .status-wrap h2, .resume h2, .contact h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 22ch; }
.section-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.sub { color: var(--slate); font-size: 1.1rem; max-width: 60ch; margin-top: 1rem; }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
  background: rgb(246 243 237);
}
/* .hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 700; max-width: 14ch; } */
.hero-copy h1 {
    color: #142024;
    letter-spacing: -.055em;
    max-width: 700px;
    margin: 25px 0 28px;
    font-size: clamp(40px, 3.65vw, 48px);
    font-weight: 560;
    line-height: 1.06;
}

.hero-copy h1 span {
    color: #6b7779;
}

.heading-period {
    color: #0f8ea0 !important;
}

.eyebrow {
    color: #3f5155;
    letter-spacing: .14em;
    align-items: center;
    gap: 9px;
    font-size: 10px;
    text-transform: uppercase;
    font-family: JetBrains Mono Variable, monospace;
    display: flex;
}

.eyebrow-pulse, .tiny-status-dot {
    background: #34d399;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    display: inline-block;
    box-shadow: 0 0 0 4px #34d39917;
}

.lead { font-size: 1.2rem; color: var(--slate); max-width: 52ch; margin-top: 1.5rem; }

.pipeline { margin: 0; background: var(--ink); color: #e6f2f3; border-radius: 16px; padding: 1.5rem; }
.pipeline figcaption { font-size: .88rem; color: #9dc0c6; margin-bottom: 1.1rem; }
.pipeline-track { position: relative; display: grid; gap: .55rem; }
.pipeline-track::before {
  content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 2px; background: #1f4a55;
}
.pipeline-track li {
  position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .7rem .9rem .7rem 2.6rem; border-radius: 8px; background: var(--ink-2);
  border: 1px solid transparent; transition: border-color .3s, background .3s;
}
.pipeline-track li::before {
  content: ""; position: absolute; left: 11px; top: 50%; translate: 0 -50%;
  width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid #3a7482;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.pipeline-track li strong { font-family: var(--font-display); font-weight: 700; }
.pipeline-track li span { font-size: .82rem; color: #9dc0c6; }
.pipeline-track li.active { border-color: var(--primary-light); background: #174652; }
.pipeline-track li.active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(244,168,79,.25); }
.pipeline-status { display: flex; align-items: center; gap: .6rem; margin: 1.1rem 0 0; font-size: .88rem; color: #b4d0d5; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
.prose p { font-size: 1.15rem; max-width: 52ch; }
.prose .btn { margin-top: .5rem; }
.pillars { display: grid; gap: 1rem; }
.pillars article, .principles article, .duo article {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
}
.pillars h3, .principles h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.pillars p, .principles p { margin: 0; color: var(--slate); }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 2.5rem; }
.stack-grid h3 { font-size: 1.15rem; padding-bottom: .6rem; margin-bottom: .75rem; border-bottom: 2px solid var(--primary); }
.stack-grid li { padding: .3rem 0; color: var(--slate); border-bottom: 1px solid var(--line); }

/* Projects */
.projects { display: grid; gap: 1.5rem; }
.project {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.project-body { padding: clamp(1.4rem, 3vw, 2.2rem); }
.project h3 { font-size: 1.7rem; margin-bottom: .4rem; }
.project-tags { color: var(--slate); font-size: .92rem; }
.project-shot, .dash-shot {
  position: relative; display: grid; align-content: end; min-height: 260px; overflow: hidden;
  background: var(--paper-2); background-image: repeating-linear-gradient(135deg, transparent 4px 14px, rgba(14,26,38,.04) 14px 15px);
  text-decoration: none;
}
.project-shot img, .dash-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .4s;  filter: brightness(88%); }
.project-shot:hover img, .dash-shot:hover img { transform: scale(1.03); }
.project-shot span, .dash-shot span {
  position: relative; margin: 1rem; justify-self: start;
  background: var(--primary); color: #fff; font-size: .85rem; font-weight: 600; padding: .4rem .9rem; border-radius: 999px;
}

/* Dark case study */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 4rem; }
.section-dark .duo article { background: var(--ink-2); border-color: #1f4a55; }
.duo h3 { font-size: 1.5rem; margin-bottom: .6rem; color: #fff; }
.duo p { margin: 0; color: #a8c8ce; } 

.arch { margin-bottom: 4rem; }
.arch h3, .model h3, .flow h3 { font-size: 1.8rem; color: #fff; }
.arch .sub { margin-bottom: 1.5rem; }
.arch-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; }
.arch-nodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.arch-nodes button {
  width: 100%; height: 100%; text-align: left; cursor: pointer; font: inherit; color: #e6f2f3;
  background: var(--ink-2); border: 1px solid #1f4a55; border-radius: var(--radius); padding: 1rem;
  display: grid; gap: .25rem; transition: border-color .15s, background .15s;
}
.arch-nodes button span { font-size: .82rem; color: #9dc0c6; }
.arch-nodes button strong { font-family: var(--font-display); font-size: 1.1rem; }
.arch-nodes button:hover { border-color: #3f7a87; }
.arch-nodes button[aria-pressed="true"] { border-color: var(--primary-light); background: #174652; }
.arch-detail { background: var(--accent); color: var(--ink); border-radius: var(--radius); padding: 1.6rem; }
.arch-detail .kicker { color: var(--ink); opacity: .7; }
.arch-detail h4 { font-size: 2rem; margin-bottom: .6rem; }
.arch-detail p:last-child { margin: 0; font-size: 1.05rem; }

.model { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; align-items: center; margin-bottom: 4rem; }
.model-copy p { color: #a8c8ce; margin-top: .75rem; max-width: 40ch; }
.star { position: relative; height: 320px; background: var(--ink-2); border: 1px solid #1f4a55; border-radius: 14px; }
.star-fact, .star-dim {
  position: absolute; display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; padding: .5rem .8rem; border-radius: 8px;
}
.star-fact { left: 50%; top: 50%; translate: -50% -50%; background: var(--primary); color: #fff; width: 170px; height: 70px; z-index: 2; }
.star-dim { background: var(--ink); border: 1px solid #3f7a87; color: #e6f2f3; width: 130px; }
.star-dim::after { content: ""; position: absolute; background: #3f7a87; z-index: 0; }
.d1 { left: 5%; top: 8%; } .d2 { right: 5%; top: 8%; } .d3 { left: 5%; bottom: 8%; } .d4 { right: 5%; bottom: 8%; }
.star::before, .star::after { content: ""; position: absolute; left: 50%; top: 50%; width: 78%; height: 2px; background: #3f7a87; translate: -50% -50%; }
.star::before { rotate: 22deg; } .star::after { rotate: -22deg; }
.star-dim::after { display: none; }

.flow ol { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; counter-reset: step; }
.flow li {
  counter-increment: step; display: flex; align-items: center; gap: .6rem;
  background: var(--ink-2); border: 1px solid #1f4a55; border-radius: 999px; padding: .5rem 1rem; font-size: .95rem;
}
.flow li::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); color: #fff; font-size: .75rem; font-weight: 700; }

/* Dashboards */
.dash-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.dash-tabs button {
  font: inherit; font-weight: 500; cursor: pointer; padding: .55rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--slate);
}
.dash-tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.dash-panel { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dash-shot { min-height: 380px; }
.dash-info { padding: clamp(1.4rem, 3vw, 2.2rem); }
.dash-info h3 { font-size: 1.7rem; }
.dash-info dl { margin: 1.5rem 0; display: grid; gap: .9rem; }
.dash-info dt { font-weight: 600; font-size: .9rem; color: var(--primary); }
.dash-info dd { margin: 0; color: var(--slate); }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Status */
.status-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.status { background: var(--ink); color: #e6f2f3; border-radius: 14px; padding: .5rem 1.4rem; font-size: .92rem; }
.status li { display: flex; justify-content: space-between; padding: .8rem 0; border-bottom: 1px solid #1f4a55; }
.status li:last-child { border-bottom: 0; }
.status b { color: #4fe0a0; font-weight: 600; }
.status-all span { color: #9dc0c6; }

/* Repos */
.repos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.repo {
  display: flex; flex-direction: column; gap: .6rem; text-decoration: none;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
  transition: border-color .15s;
}
.repo:hover { border-color: var(--primary); }
.repo h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: 0; }
.repo p { color: var(--slate); margin: 0; flex: 1; }
.repo span { font-size: .85rem; color: var(--primary); font-weight: 500; }

/* Resume */
.resume { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.roles { display: grid; gap: .75rem; }
.roles li { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.25rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }

/* Contact */
.contact { text-align: left; }
.contact .open { display: inline-flex; align-items: center; gap: .6rem; background: var(--ink-2); border: 1px solid #1f4a55; padding: .4rem 1rem; border-radius: 999px; font-size: .9rem; margin-bottom: 1.5rem; }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 5.5vw, 4.2rem); max-width: 16ch; }
.note { margin-top: 1.5rem; color: #86aab1; font-size: .92rem; }

/* Contact: image left, text right */
.contact-inner {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.contact-media { margin: 0; }
.contact-media img {
  width: 100%;
  aspect-ratio: 0.5;
  object-fit: cover;
  object-position: top;
  border-radius: 10%;
  border: 2px solid var(--ink-2);
  box-shadow: 0 0 0 3px var(--primary), 0 24px 48px -24px rgba(0, 0, 0, .6);
  background: var(--primary);
}
.contact-copy .sub { max-width: 46ch; }

@media (max-width: 760px) {
  .contact-inner { grid-template-columns: 1fr; justify-items: start; }
  /* .contact-media { width: min(220px, 60%); height: auto; } */
  .contact-media {visibility: hidden; display: none; }
}

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem); background: var(--ink); color: #b4d0d5; border-top: 1px solid #1f4a55; font-size: .92rem;
}
.foot-brand { display: flex; align-items: center; gap: .75rem; }
.foot-brand strong { display: block; color: #fff; font-family: var(--font-display); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: #fff; }
.site-footer p { margin: 0; width: 100%; color: #75a0a8; }

/* Responsive */
@media (max-width: 920px) {
  .hero, .about-grid, .project, .arch-layout, .model, .dash-panel, .status-wrap, .resume, .duo { grid-template-columns: 1fr; }
  .stack-grid, .principles, .repos { grid-template-columns: 1fr 1fr; }
  .project-shot, .dash-shot { min-height: 220px; }
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start;
    gap: 1.1rem; padding: 1.25rem clamp(1rem, 4vw, 3rem) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -20px rgba(11, 38, 45, .35);
  }
  .nav.open { display: flex; }
}
@media (max-width: 600px) {
  .stack-grid, .principles, .repos, .arch-nodes { grid-template-columns: 1fr; }
  .star { height: 300px; }
  .star-dim { width: 105px; font-size: .75rem; }
  .star-fact { width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .btn:hover { transform: none; }
}

.section-dark :focus-visible, .site-footer :focus-visible, .pipeline :focus-visible { outline-color: var(--accent); }
