/* Original layout inspired by Colorlib “Me” structure.
   Palette: atlantic ink, sea-glass, mist — not sage-on-white, not purple, not terracotta. */

:root {
  --ink: #12202a;
  --ink-soft: #3d5563;
  --navy: #0e2433;
  --navy-deep: #08151f;
  --sea: #0f6e63;
  --sea-dark: #0b5249;
  --danger: #9b2c2c;
  --cyan: #2eb8d6;
  --cyan-soft: #c5ecf5;
  --mist: #e7eef2;
  --paper: #f4f8f9;
  --white: #fbfefe;
  --line: #cfdce3;
  --header-h: 4.75rem;
  --max: 72rem;
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --font-display: "Syne", "Trebuchet MS", sans-serif;
  --font-headline: "Fraunces", "Source Serif 4", Georgia, serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-pill: 2rem;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--sea);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -5rem;
  z-index: 1000;
  padding: 0.55rem 0.9rem;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.7rem;
}

/* Header — centered wordmark with links on both sides */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(244, 248, 249, 0.72);
  backdrop-filter: blur(14px);
  color: var(--ink);
  transition: box-shadow 280ms var(--ease), background 280ms var(--ease);
}

.site-header.is-scrolled,
.site-header.is-solid,
.site-header.is-open {
  background: rgba(251, 254, 254, 0.94);
  box-shadow: 0 1px 0 rgba(14, 36, 51, 0.08);
}

.site-header__inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  flex: 1;
}

.wordmark {
  display: none;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--sea);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  justify-self: end;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  border-radius: 4px;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  color: var(--sea);
}

.site-nav__brand {
  justify-self: center;
}

.site-nav__brand a {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  color: var(--sea);
}

.site-nav__brand a:hover {
  color: var(--navy);
}

/* Hero — copy left, overflowing portrait right */

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(rgba(14, 36, 51, 0.045) 1px, transparent 1px),
    var(--mist);
  background-size: 22px 22px, auto;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(2rem, 8vh, 5rem) var(--gutter) clamp(2.5rem, 8vh, 5rem) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}

.hero__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.4vw, 4.35rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero__lead {
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--sea);
  margin-bottom: 0.2em;
}

.hero__title em {
  font-style: normal;
  display: block;
}

.hero__subtitle {
  margin: 0 0 0.55rem;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--ink);
}

.hero__lede {
  margin: 0 0 1.6rem;
  max-width: 28rem;
}

.hero__actions {
  margin: 0;
}

.hero__copy > * {
  animation: rise 0.85s var(--ease) both;
}

.hero__copy > :nth-child(1) { animation-delay: 0.05s; }
.hero__copy > :nth-child(2) { animation-delay: 0.14s; }
.hero__copy > :nth-child(3) { animation-delay: 0.22s; }
.hero__copy > :nth-child(4) { animation-delay: 0.3s; }

.hero__media {
  position: relative;
  min-height: 28rem;
}

.hero__media img {
  position: absolute;
  right: -4%;
  bottom: 0;
  width: min(48rem, 118%);
  height: 104%;
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
  mix-blend-mode: multiply;
  animation: rise 1s var(--ease) 0.18s both;
}

.is-pending {
  opacity: 0;
  transform: translateY(16px);
}

.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.55rem 1.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--sea);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--sea-dark);
  color: var(--white);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--quiet:hover {
  color: var(--sea);
  border-color: var(--sea);
}

#home,
#services,
#about,
#work,
#experience,
#focus,
#stack,
#contact,
#main {
  scroll-margin-top: calc(var(--header-h) + 0.4rem);
}

#experience .section-title {
  margin-bottom: 1.5rem;
}

.section {
  padding: clamp(4.25rem, 9vw, 7rem) var(--gutter);
}

.section__inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: 44rem;
}

.section-title {
  margin: 0 0 2.25rem;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.section-title--center {
  text-align: center;
}

.section-title--on-dark {
  color: var(--white);
}

.section-intro {
  max-width: 38rem;
  margin: -1.25rem auto 2.25rem;
  text-align: center;
}

.section-intro--left {
  margin: 0 0 2rem;
  text-align: left;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}

.section-foot {
  margin: 2rem 0 0;
  text-align: center;
}

/* Services — 2×2 icon cards */

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.service {
  display: flex;
  gap: 1.15rem;
  padding: 1.6rem 1.4rem;
  background: rgba(251, 254, 254, 0.7);
  border: 1px solid rgba(207, 220, 227, 0.7);
}

.service h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.service p {
  margin: 0;
}

.service__icon {
  flex: 0 0 3.1rem;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sea);
  color: var(--white);
}

.service__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* About — three columns with portrait in the middle */

.about-grid {
  display: grid;
  grid-template-columns: 1fr minmax(12rem, 0.85fr) 1fr;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: center;
}

.about-copy p {
  margin: 0 0 1rem;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy .btn {
  margin-top: 0.35rem;
}

.about-portrait {
  isolation: isolate;
  background: var(--mist);
  padding-top: 2.5rem;
}

.about-portrait img {
  display: block;
  width: 100%;
  mix-blend-mode: multiply;
}

/* Work grid */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease);
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(14, 36, 51, 0.1);
  color: inherit;
}

.work-card__visual {
  display: grid;
  place-items: end start;
  min-height: 13.5rem;
  padding: 0.85rem 1rem;
  color: var(--cyan-soft);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-card__visual--a {
  background: var(--navy);
}

.work-card__visual--b {
  background: #123247;
}

.work-card__visual--c {
  background: var(--navy-deep);
}

.work-card__visual--d {
  background: var(--sea-dark);
}

.work-card__visual--e {
  background: #1a3d4d;
}

.work-card__visual--f {
  background: var(--sea);
}

.work-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.05rem 1.15rem;
}

.work-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.work-card__meta {
  font-size: 0.92rem;
  line-height: 1.45;
}

.project {
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
  padding: 1.6rem 0 1.7rem;
  border-bottom: 1px solid var(--line);
}

.project:first-of-type {
  border-top: 1px solid var(--line);
}

.project__tag {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea);
}

.project h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.project p {
  margin: 0 0 0.7rem;
  max-width: 40rem;
}

.project p:last-child {
  margin-bottom: 0;
}

/* Experience — dates left, role right */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: minmax(8.25rem, 0.26fr) minmax(0, 1fr);
  gap: 0.45rem 1.35rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline__when {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--sea);
  padding-top: 0.2rem;
}

.timeline h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: break-word;
}

.timeline__org {
  margin: 0.15rem 0 0;
  color: var(--ink);
}

.timeline__note {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.timeline--compact li {
  padding: 0.65rem 0;
}

.section-subhead {
  margin: 2.15rem 0 0.85rem;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: center;
}

/* Dark band — honest stand-in for testimonials */

.section--focus {
  background: var(--navy-deep);
  color: rgba(251, 254, 254, 0.82);
}

.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.focus-grid article {
  margin: 0;
}

.focus-grid p {
  margin: 0;
  font-family: var(--font-headline);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--white);
}

.focus-grid h3 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* Stack wordmarks */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stack-grid li {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  letter-spacing: -0.03em;
  color: var(--navy);
  background: rgba(251, 254, 254, 0.65);
  border: 1px solid var(--line);
}

/* Contact */

.contact-form {
  margin-top: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  margin: 0 0 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 254, 254, 0.6);
  color: var(--ink);
  font: inherit;
  border-radius: 0;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.form-field input.is-invalid,
.form-field textarea.is-invalid {
  border-bottom-color: var(--danger);
}

.form-field-error {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--danger);
}

.form-field-error[hidden] {
  display: none;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  margin: 0.5rem 0 0;
}

.form-status {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--sea);
  background: rgba(15, 110, 99, 0.08);
  border-left: 3px solid var(--sea);
}

.form-status:focus {
  outline: none;
}

.form-status:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.form-status.is-pending {
  color: var(--ink-soft);
  background: rgba(61, 85, 99, 0.08);
  border-left-color: var(--ink-soft);
}

.form-status.is-success {
  color: var(--sea);
  background: rgba(15, 110, 99, 0.08);
  border-left-color: var(--sea);
}

.form-status.is-error {
  color: var(--danger);
  background: rgba(155, 44, 44, 0.08);
  border-left-color: var(--danger);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 700;
}

.page-hero {
  padding: 3.25rem var(--gutter) 2.5rem;
  background: var(--navy);
  color: var(--white);
}

.page-hero h1 {
  margin: 0 0 0.8rem;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--white);
}

.page-hero p {
  margin: 0;
  font-style: italic;
  color: var(--cyan-soft);
  font-size: 1.2rem;
}

.page-hero .kicker {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.note {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

/* Footer */

.site-footer {
  padding: 4rem var(--gutter) 2rem;
  background:
    radial-gradient(rgba(14, 36, 51, 0.04) 1px, transparent 1px),
    var(--mist);
  background-size: 22px 22px, auto;
  color: var(--ink-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 1.75rem 2rem;
  margin-bottom: 2.5rem;
}

.site-footer h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--sea);
}

.footer-copy {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .work-grid,
  .stack-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .about-portrait {
    order: -1;
    max-width: 22rem;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .wordmark {
    display: inline;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--white);
    display: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(14, 36, 51, 0.08);
  }

  .site-header.is-open .site-nav {
    display: block;
  }

  .site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.4rem var(--gutter) 1.1rem;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
  }

  .site-nav__brand {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(38svh, 1fr);
    min-height: 0;
  }

  .hero__copy {
    padding: 2.25rem var(--gutter) 0.5rem;
    justify-content: flex-end;
  }

  .hero__media {
    min-height: 42svh;
  }

  .hero__media img {
    width: min(30rem, 100%);
    height: 102%;
    left: 0;
    right: 0;
    margin-inline: auto;
    object-fit: contain;
    object-position: center bottom;
  }

  .service-grid,
  .focus-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 7.25rem minmax(0, 1fr);
    gap: 0.3rem 0.9rem;
    padding: 0.75rem 0;
  }

  .work-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .work-grid,
  .stack-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
  }

  .hero__lede {
    max-width: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
