/* ==========================================================================
   Sadie May Portfolio — Structure in Motion / Warm Editorial Operator
   ========================================================================== */

:root {
  /* Color tokens */
  --color-ivory: #FAF6EF;
  --color-charcoal: #2A2622;
  --color-taupe: #C9BDAE;
  --color-taupe-dark: #8C8071;
  --color-gold: #B08D4F;
  --color-gold-light: #D9C08F;
  --color-plum: #5C3A4A;
  --color-plum-tint: #EFE3E8;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: 7rem;

  /* Layout */
  --content-max: 1120px;
  --radius: 4px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-ivory);
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  color: var(--color-charcoal);
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; font-weight: 600; }

p { margin: 0 0 var(--space-sm); }

a { color: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-charcoal);
  color: var(--color-ivory);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

/* ---------- Eyebrow / signature mark ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-plum);
  margin-bottom: var(--space-sm);
}

.signature-mark {
  display: inline-block;
  width: 22px;
  height: 10px;
  flex-shrink: 0;
  background-image: radial-gradient(circle at 2px 8px, var(--color-gold) 1.6px, transparent 1.7px),
                     radial-gradient(circle at 11px 2px, var(--color-gold) 1.6px, transparent 1.7px),
                     radial-gradient(circle at 20px 6px, var(--color-gold) 1.6px, transparent 1.7px);
  position: relative;
}
.signature-mark::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 18px; height: 1px;
  background: var(--color-taupe-dark);
  transform-origin: left center;
  transform: rotate(-18deg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.btn-primary {
  background: var(--color-gold);
  color: var(--color-ivory);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--color-gold-light);
  color: var(--color-charcoal);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--color-charcoal);
  color: var(--color-ivory);
}

.btn-nav {
  padding: 0.6rem 1.25rem;
  font-size: 0.88rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-taupe);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-charcoal);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.primary-nav ul {
  display: flex;
  gap: var(--space-md);
}

.primary-nav a:not(.btn) {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.primary-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 1.5px;
  background: var(--color-gold);
  transition: width 0.25s var(--ease);
}
.primary-nav a:not(.btn):hover::after,
.primary-nav a:not(.btn):focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-charcoal);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-charcoal);
  max-width: 42ch;
  margin-bottom: var(--space-md);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.portrait-frame {
  width: min(360px, 100%);
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-taupe);
  border: 1px solid var(--color-taupe-dark);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
}

.motion-mark {
  position: absolute;
  width: 130px;
  height: 130px;
  top: -30px;
  right: -20px;
  pointer-events: none;
}
.mm-line {
  stroke: var(--color-gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-line 1.8s var(--ease) 0.3s forwards;
}
.mm-dot { fill: var(--color-plum); opacity: 0; animation: dot-in 0.5s var(--ease) forwards; }
.mm-dot--1 { animation-delay: 0.1s; }
.mm-dot--2 { animation-delay: 0.5s; }
.mm-dot--3 { animation-delay: 0.9s; }
.mm-dot--4 { animation-delay: 1.3s; }
.mm-dot--5 { animation-delay: 1.7s; }

@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }

/* ---------- Credibility strip ---------- */
.proof {
  background: var(--color-charcoal);
  color: var(--color-ivory);
  padding: var(--space-lg) 0;
}

.proof-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  text-align: center;
}

.proof-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.proof-number {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.3vw, 1.8rem);
  color: var(--color-gold-light);
  font-weight: 600;
}

.proof-label {
  font-size: 0.85rem;
  color: var(--color-taupe);
}

/* ---------- Problem section ---------- */
.problem {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.problem-inner {
  max-width: 720px;
}

.problem-list {
  text-align: left;
  display: inline-block;
  margin: var(--space-md) auto;
}

.problem-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  font-size: 1.05rem;
}

.problem-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold);
}

.problem-close {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--color-plum);
  margin-top: var(--space-md);
}

/* ---------- Services ---------- */
.services {
  padding: var(--space-2xl) 0;
  background: var(--color-taupe);
}

.services h2 { max-width: 30ch; margin-bottom: var(--space-lg); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.service-card {
  background: var(--color-ivory);
  border-radius: var(--radius);
  padding: var(--space-md);
  border: 1px solid var(--color-taupe-dark);
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-plum);
  margin: var(--space-sm) 0 0.2rem;
}

/* ---------- Work / case studies ---------- */
.work {
  padding: var(--space-2xl) 0;
}

.work h2 { max-width: 32ch; margin-bottom: var(--space-lg); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.case-card {
  grid-column: span 1;
  background: var(--color-ivory);
  border: 1px solid var(--color-taupe-dark);
  border-radius: var(--radius);
  overflow: hidden;
}

.case-card--flagship {
  grid-column: 1 / -1;
  background: var(--color-plum-tint);
  border-color: var(--color-plum);
}

.case-card-body { padding: var(--space-md); }

.case-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.4rem;
}

.case-teaser { color: var(--color-charcoal); }

.case-detail summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-plum);
  padding: 0.6rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.case-detail summary::-webkit-details-marker { display: none; }
.case-detail summary::after {
  content: "\2193";
  transition: transform 0.25s var(--ease);
  font-size: 0.8em;
}
.case-detail[open] summary::after { transform: rotate(180deg); }

.case-detail-body {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-taupe);
  margin-top: var(--space-xs);
}

.case-skills { color: var(--color-taupe-dark); font-size: 0.92rem; }

.case-visual {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius);
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.flow-steps li {
  background: var(--color-charcoal);
  color: var(--color-ivory);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.flow-steps li:not(:last-child)::after {
  content: "\2192";
  margin-left: 0.4rem;
  color: var(--color-gold-light);
}

.mock-dashboard {
  margin-top: var(--space-sm);
  border: 1px solid var(--color-taupe-dark);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-ivory);
}
.mock-dashboard-bar {
  height: 22px;
  background: var(--color-charcoal);
}
.mock-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-taupe);
}
.mock-dashboard-grid span {
  background: var(--color-ivory);
  padding: 0.9rem;
  font-size: 0.8rem;
  color: var(--color-taupe-dark);
}

.case-visual-disclaimer {
  font-size: 0.75rem;
  color: var(--color-taupe-dark);
  margin: var(--space-sm) 0 0;
  font-style: italic;
}

.case-visual--before-after {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}
.ba-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.ba-col ul { display: flex; flex-direction: column; gap: 0.3rem; }
.ba-col li {
  font-size: 0.85rem;
  padding-left: 0.9rem;
  position: relative;
}
.ba-col li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-taupe-dark);
}
.ba-col--work .ba-label { color: var(--color-plum); }
.ba-col--work li::before { background: var(--color-gold); }

/* ---------- About ---------- */
.about {
  padding: var(--space-2xl) 0;
  background: var(--color-charcoal);
  color: var(--color-ivory);
}

.about h2, .about .eyebrow { color: var(--color-ivory); }
.about .eyebrow { color: var(--color-gold-light); }

.about-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-img {
  border-radius: var(--radius);
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center top;
  background: var(--color-taupe);
}

.about-copy p { color: rgba(250, 246, 239, 0.88); }

.about-credential {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold-light);
  border: 1px solid var(--color-gold);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin: 0.2rem 0 1rem;
}

/* ---------- Process ---------- */
.process {
  padding: var(--space-2xl) 0;
}

.process-intro {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-plum);
  max-width: 60ch;
  margin-bottom: var(--space-lg);
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  position: relative;
}

.process-steps li {
  padding-top: var(--space-md);
  border-top: 2px solid var(--color-gold);
  position: relative;
}

.process-step-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--color-plum);
}

.process-steps li p { font-size: 0.92rem; color: var(--color-taupe-dark); margin: 0; }

/* ---------- Contact ---------- */
.contact {
  padding: var(--space-2xl) 0;
  background: var(--color-taupe);
}

.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-xl);
}

.contact-intro h2 { max-width: 18ch; }

.contact-form {
  background: var(--color-ivory);
  padding: var(--space-lg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-row { display: flex; flex-direction: column; gap: 0.4rem; }

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
}

.form-row input,
.form-row textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--color-taupe-dark);
  border-radius: var(--radius);
  background: var(--color-ivory);
  color: var(--color-charcoal);
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--color-plum);
  outline: none;
}

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--color-plum);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-taupe);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.footer-name { font-family: var(--font-display); font-weight: 600; margin: 0; }

.footer-links { display: flex; gap: var(--space-md); }
.footer-links a { text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-plum); }

.footer-copyright {
  font-size: 0.82rem;
  color: var(--color-taupe-dark);
  margin: 0;
  width: 100%;
  order: 3;
}

/* ---------- Scroll fade-in ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .mm-line, .mm-dot { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .motion-mark { display: none; }
  .about-inner { grid-template-columns: 1fr; }
  .about-media { order: -1; max-width: 280px; }
  .contact-inner { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .case-card--flagship { grid-column: auto; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .hero {
    padding-top: var(--space-lg); /* 48px, down from 112px */
  }

  .primary-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--color-ivory);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg) 1.5rem;
    gap: var(--space-lg);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
    overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; gap: var(--space-md); }
  .primary-nav a:not(.btn) { font-size: 1.1rem; }
  .nav-toggle { display: flex; }

  .proof-inner { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .process-steps li { border-top: none; border-left: 2px solid var(--color-gold); padding-top: 0; padding-left: var(--space-sm); }
  .case-visual--before-after { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
