/* KSC GROUPE — personal site
   palette: navy + emerald · typography: serif display + sans body
   motion: page-load orchestration · layout: case-study portfolio
   signature: expandable index (accordion on approach) · background: plain */

:root {
  --bg: #ffffff;
  --surface: #f3f6f8;
  --surface-2: #e9eef2;
  --ink: #0f2a4a;
  --ink-soft: #3d5670;
  --muted: #5b6b7f;
  --accent: #1f8a5b;
  --accent-ink: #ffffff;
  --rule: #dbe3ea;
  --focus: #1f8a5b;
  --shadow: 0 1px 2px rgba(15, 42, 74, .06), 0 12px 32px -18px rgba(15, 42, 74, .35);
  --radius: 14px;
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  --section-y: clamp(64px, 9vw, 120px);
}

html[data-theme="dark"] {
  --bg: #0b1622;
  --surface: #101f2e;
  --surface-2: #16293b;
  --ink: #eaf1f7;
  --ink-soft: #c2d2e0;
  --muted: #9db0c2;
  --accent: #3fbd85;
  --accent-ink: #06131d;
  --rule: #23384b;
  --focus: #6fe0ab;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; margin-right: auto;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-family: 'Inter Tight', sans-serif; font-weight: 600;
  font-size: .78rem; letter-spacing: .04em;
}
.brand-name {
  font-family: 'Fraunces', serif; font-size: 1.02rem;
  letter-spacing: .01em; color: var(--ink);
}
.nav { display: flex; gap: clamp(.5rem, 2vw, 1.6rem); }
.nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: .95rem; padding: .55rem .15rem;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) var(--section-y); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.eyebrow {
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 .9rem;
}
.hero h1 { margin-bottom: 1.1rem; }
.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft); max-width: 46ch;
}
.hero-note {
  font-size: .95rem; color: var(--muted);
  border-left: 2px solid var(--accent); padding-left: .85rem;
  margin-top: 1.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: .7rem 1.35rem;
  border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: .97rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: transform .16s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--surface-2);
}
.hero-figure figcaption {
  margin-top: .7rem; font-size: .85rem; color: var(--muted);
}

/* ---------- sections ---------- */
.section { padding-block: var(--section-y); }
.section-alt { background: var(--surface); }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head h2 { margin-bottom: .9rem; }
.section-intro { color: var(--ink-soft); }

.two-col {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: clamp(28px, 5vw, 72px); align-items: start;
}
.prose { max-width: 66ch; color: var(--ink-soft); }
.prose p { margin-bottom: 1.1rem; }

.facts {
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(20px, 3vw, 30px);
}
.section-alt .facts { background: var(--bg); }
.facts h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.facts dl { margin: 0; display: grid; gap: .9rem; }
.facts dl > div { border-top: 1px solid var(--rule); padding-top: .8rem; }
.facts dl > div:first-child { border-top: 0; padding-top: 0; }
.facts dt {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .2rem;
}
.facts dd { margin: 0; font-size: .97rem; color: var(--ink); }

/* ---------- projects ---------- */
.projects { display: grid; gap: 0; }
.project {
  display: grid; grid-template-columns: 1.25fr 1fr;
  gap: clamp(24px, 4vw, 64px); align-items: center;
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}
.project:first-child { border-top: 0; padding-top: 0; }
.project:nth-child(even) .project-media { order: 2; }
.project-media { margin: 0; }
.project-media img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); background: var(--surface-2);
}
.project-meta {
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .5rem;
}
.project-body h3 { margin-bottom: .7rem; }
.project-role { font-size: .95rem; color: var(--ink); margin-bottom: .6rem; }
.project-body p { color: var(--ink-soft); }
.tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: .45rem;
  padding: 0; margin: 1rem 0 0;
}
.tags li {
  font-size: .8rem; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .25rem .7rem; background: var(--bg);
}

/* ---------- approach ---------- */
.steps {
  list-style: none; padding: 0; margin: 0 0 clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}
.steps li {
  border-top: 2px solid var(--accent);
  padding-top: 1.1rem;
}
.step-num {
  display: block; font-family: 'Fraunces', serif;
  font-size: 1.6rem; color: var(--accent); margin-bottom: .5rem;
}
.steps h3 { margin-bottom: .6rem; }
.steps p { color: var(--ink-soft); font-size: .98rem; }

.services {
  background: var(--surface); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
}
.services-title { margin-bottom: 1.1rem; }
.services-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2rem;
}
.services-list li {
  color: var(--ink-soft); font-size: .98rem;
  padding-left: 1.1rem; position: relative;
}
.services-list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.services-list strong { color: var(--ink); font-weight: 600; }
.services-note { margin-top: 1.4rem; font-size: .88rem; color: var(--muted); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: clamp(28px, 5vw, 72px); align-items: start;
}
.contact-copy h2 { margin-bottom: 1rem; }
.contact-copy p { color: var(--ink-soft); max-width: 44ch; }
.contact-details {
  list-style: none; padding: 0; margin: 1.8rem 0 0;
  display: grid; gap: .9rem;
}
.contact-details li { font-size: .97rem; color: var(--ink); }
.contact-details span {
  display: block; font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .15rem;
}
.contact-details a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.contact-details a:hover { opacity: .8; }

.contact-form {
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(22px, 3.5vw, 36px);
  display: grid; gap: 1rem;
}
.field { display: grid; gap: .35rem; }
.field label {
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 9px; padding: .7rem .85rem; width: 100%;
  transition: border-color .18s ease, background .18s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  border-color: var(--accent); background: var(--bg);
  outline: 2px solid transparent;
}
.contact-form .btn { justify-self: start; margin-top: .3rem; }
.form-status { font-size: .92rem; margin: 0; color: var(--ink-soft); }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: #c0392b; }
html[data-theme="dark"] .form-status.is-error { color: #ff8a7a; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(32px, 4vw, 48px);
  background: var(--bg);
}
.footer-inner { display: grid; gap: .4rem; }
.footer-brand {
  font-family: 'Fraunces', serif; font-size: 1.05rem;
  color: var(--ink); margin: 0;
}
.footer-line { font-size: .9rem; color: var(--muted); margin: 0; }
.attribution {
  position: static; margin: .6rem 0 0; font-size: .78rem;
  opacity: 1; color: var(--muted);
}
.attribution a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.attribution a:hover { color: var(--ink); }

/* ---------- page-load orchestration ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: riseIn .7s cubic-bezier(.2,.7,.1,1) both; }
  .hero-copy > *:nth-child(1) { animation-delay: .05s; }
  .hero-copy > *:nth-child(2) { animation-delay: .15s; }
  .hero-copy > *:nth-child(3) { animation-delay: .25s; }
  .hero-copy > *:nth-child(4) { animation-delay: .33s; }
  .hero-copy > *:nth-child(5) { animation-delay: .41s; }
  .hero-figure { animation: fadeIn .9s ease .2s both; }
  .site-header { animation: slideDown .5s cubic-bezier(.2,.7,.1,1) both; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .hero-figure img { aspect-ratio: 16 / 11; }
  .two-col { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media { order: 0; }
  .steps { grid-template-columns: 1fr; }
  .services-list { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .header-inner { min-height: 62px; }
  .hero-actions .btn { flex: 1 1 auto; }
}
