/* =============================================================
   HEIDI EKEY — PORTFOLIO
   Concept: "PROOF" — editorial proofreading marks as a design system.
   Mobile-first. Design tokens as CSS custom properties.
   ============================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Colour — warm paper, warm ink, one editorial accent */
  --paper:        #F7F3EC;
  --paper-2:      #EFE8DC;
  --paper-3:      #E5DCCC;
  --ink:          #1A1815;
  --ink-2:        #3B3730;
  --muted:        #6A6357;
  --rule:         #D3C9B6;
  --accent:       #C0392B;  /* editor's ink */
  --accent-soft:  #F2E0DA;
  --white:        #FFFDF9;

  /* Type */
  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --f-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --f-mark:    "Caveat", "Bradley Hand", "Segoe Script", cursive;

  /* Fluid type scale */
  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-lg:   clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  --t-xl:   clamp(1.25rem, 1vw + 1rem, 1.5rem);
  --t-2xl:  clamp(1.5rem, 2vw + 1rem, 2.125rem);
  --t-3xl:  clamp(2rem, 4vw + 1rem, 3.25rem);
  --t-4xl:  clamp(2.5rem, 7vw + 1rem, 5.5rem);
  --t-5xl:  clamp(3rem, 11vw + 1rem, 8.5rem);

  /* Spacing scale (8pt base) */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;

  --wrap: 1240px;
  --wrap-narrow: 680px;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(26,24,21,.06), 0 8px 24px rgba(26,24,21,.08);
  --shadow-lift: 0 2px 4px rgba(26,24,21,.08), 0 18px 44px rgba(26,24,21,.14);
  --ease: cubic-bezier(.2,.7,.3,1);
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;              /* guards against decorative overhang on mobile */
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4 { margin: 0 0 var(--s-4); line-height: 1.1; font-weight: 600; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.15em; }
li { margin-bottom: var(--s-2); }
a { color: inherit; }

/* Paper texture — pure CSS, no image request */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .35;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(180,160,120,.05) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(160,140,110,.045) 0 2px, transparent 2px),
    radial-gradient(circle at 45% 85%, rgba(190,170,130,.04) 0 1.5px, transparent 2px);
  background-size: 180px 180px, 240px 240px, 140px 140px;
}
main, header, footer { position: relative; z-index: 1; }

/* ---------- 3. ACCESSIBILITY ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--paper);
  padding: var(--s-3) var(--s-5); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: var(--s-4); top: var(--s-4); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.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;
}

/* ---------- 4. LAYOUT ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-5); }
.wrap--narrow { max-width: var(--wrap-narrow); }
.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-7); }
.section--paper2 { background: var(--paper-2); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .eyebrow { color: var(--paper-3); }
.section--ink a { color: var(--paper); }

@media (min-width: 900px) {
  .section { padding-block: var(--s-9); }
  .section--tight { padding-block: var(--s-8); }
}

/* ---------- 5. TYPE ---------- */
.eyebrow {
  font-family: var(--f-body);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-4);
  display: flex; align-items: center; gap: var(--s-3);
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.eyebrow--plain::after { display: none; }

.display   { font-family: var(--f-display); font-weight: 600; letter-spacing: -.02em; }
.h-hero    { font-family: var(--f-display); font-size: var(--t-4xl); line-height: .98; letter-spacing: -.03em; font-weight: 600; }
.h-section { font-family: var(--f-display); font-size: var(--t-3xl); line-height: 1.04; letter-spacing: -.02em; }
.h-sub     { font-family: var(--f-display); font-size: var(--t-2xl); line-height: 1.15; }
.lede      { font-size: var(--t-xl); line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.body-lg   { font-size: var(--t-lg); line-height: 1.7; }
.small     { font-size: var(--t-sm); color: var(--muted); }

.prose { max-width: 62ch; }
.prose p { font-size: var(--t-lg); line-height: 1.75; }

/* Editorial marks — the "annotation" layer */
.mark {                        /* handwritten margin note; decorative only */
  font-family: var(--f-mark);
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--accent);
  transform: rotate(-2.5deg);
  display: inline-block;
}
.underline-mark {              /* hand-drawn underline under a word */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 92%;
  padding-bottom: .06em;
}
.circle-mark {                 /* editor's circle around a word */
  position: relative; display: inline-block; padding: 0 .18em;
}
.circle-mark::after {
  content: ""; position: absolute; inset: -22% -10%;
  border: 2px solid var(--accent);
  border-radius: 48% 52% 50% 50% / 58% 45% 55% 42%;
  transform: rotate(-1.5deg);
  pointer-events: none;
}
.caret {                       /* proofreader's insertion caret */
  color: var(--accent); font-family: var(--f-body); font-weight: 700;
}
.folio {                       /* numbered project marker */
  font-family: var(--f-display);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
  display: inline-block;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.strike { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; color: var(--muted); }

/* ---------- 6. BUTTONS + LINKS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--f-body); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: var(--s-3) var(--s-5);
  border: 2px solid var(--ink); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.section--ink .btn--ghost { color: var(--paper); border-color: var(--paper); }
.section--ink .btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn:active { transform: translateY(1px); }

.link-arrow {
  font-weight: 600; text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  transition: color .18s var(--ease);
}
.link-arrow:hover { color: var(--accent); }
.link-arrow::after { content: " →"; }

.text-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.text-link:hover { text-decoration-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- 7. HEADER / NAV ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,243,236,.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.brand__name { font-family: var(--f-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.brand__role { font-size: .625rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s-2) var(--s-3); font: inherit; font-size: var(--t-sm); font-weight: 600;
  cursor: pointer; color: var(--ink);
}
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--s-1);
}
.nav-list a {
  display: block; padding: var(--s-3) 0;
  text-decoration: none; font-size: var(--t-sm); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--accent); }
#site-nav { display: none; padding-bottom: var(--s-4); }
#site-nav.is-open { display: block; }

@media (min-width: 880px) {
  .nav-toggle { display: none; }
  #site-nav { display: block !important; padding-bottom: 0; }
  .nav-list { flex-direction: row; gap: var(--s-5); align-items: center; }
  .nav-list a { padding: var(--s-2) 0; border-bottom: 2px solid transparent; }
  .nav-list a:hover, .nav-list a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); }
  .nav-inner { min-height: 76px; }
}

/* ---------- 8. HERO ---------- */
.hero { padding-block: var(--s-7) var(--s-8); position: relative; overflow: hidden; }
.hero__grid { display: grid; gap: var(--s-6); }
.hero__stamp {
  display: inline-block; font-size: var(--t-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1.5px solid var(--accent);
  padding: 6px 12px; border-radius: var(--radius); margin-bottom: var(--s-5);
  transform: rotate(-1deg);
}
.hero h1 { margin-bottom: var(--s-5); }
.hero__sub { font-size: var(--t-lg); line-height: 1.65; color: var(--ink-2); max-width: 52ch; margin-bottom: var(--s-6); }
.hero__name {
  font-family: var(--f-body); font-size: var(--t-sm); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  margin-bottom: var(--s-4);
}

/* Layered collage of real work — the energetic element */
.hero__collage { position: relative; min-height: 320px; }
.hero__collage img {
  position: absolute; border: 1px solid var(--rule); background: var(--white);
  box-shadow: var(--shadow); object-fit: cover; object-position: top center;
}
.hero__collage img:nth-child(1) { width: 46%; top: 0;    left: 2%;  aspect-ratio: 3/4;   transform: rotate(-3deg); }
.hero__collage img:nth-child(2) { width: 44%; top: 12%;  right: 3%; aspect-ratio: 3/4;   transform: rotate(2.5deg); }
.hero__collage img:nth-child(3) { width: 40%; bottom: 0; left: 22%; aspect-ratio: 4/3;   transform: rotate(-1deg); z-index: 2; }
.hero__collage .mark { position: absolute; bottom: 6%; right: 4%; z-index: 3; max-width: 42%; text-align: right; }

@media (min-width: 900px) {
  .hero { padding-block: var(--s-8) var(--s-9); }
  .hero__grid { grid-template-columns: 1.15fr .85fr; align-items: center; gap: var(--s-8); }
  .hero__collage { min-height: 460px; }
}

/* ---------- 9. PROOF STRIP ---------- */
.proof { border-block: 2px solid var(--ink); background: var(--paper-2); }
.proof__list {
  list-style: none; margin: 0; padding: var(--s-5) 0;
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(2, 1fr);
}
.proof__list li { margin: 0; }
.proof__n { font-family: var(--f-display); font-size: var(--t-2xl); font-weight: 600; line-height: 1; display: block; letter-spacing: -.02em; }
.proof__l { font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: var(--s-2); display: block; }
@media (min-width: 760px) { .proof__list { grid-template-columns: repeat(5, 1fr); } }

/* ---------- 10. WORK CARDS ---------- */
.work-grid { display: grid; gap: var(--s-7); }
@media (min-width: 820px) { .work-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-8) var(--s-7); } }

.work-card { position: relative; }
.work-card__media {
  position: relative; background: var(--paper-2);
  border: 1px solid var(--rule); overflow: hidden;
  aspect-ratio: 4/3; margin-bottom: var(--s-4);
}
.work-card__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform .5s var(--ease);
}
.work-card:hover .work-card__media img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .work-card:hover .work-card__media img { transform: none; }
}
.work-card__folio { position: absolute; top: var(--s-3); left: var(--s-3); background: var(--paper); padding: 2px 8px; z-index: 2; }
.work-card__client { font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: var(--s-2); }
.work-card h3 { font-family: var(--f-display); font-size: var(--t-2xl); margin-bottom: var(--s-3); line-height: 1.1; }
.work-card h3 a { text-decoration: none; }
.work-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole-card click target */
.work-card h3 a:hover { color: var(--accent); }
.work-card p { color: var(--ink-2); margin-bottom: var(--s-3); }
.work-card__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.work-card__tags li {
  font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule); padding: 3px 8px; margin: 0;
}
/* Feature variant — first card spans full width on desktop */
@media (min-width: 820px) {
  .work-card--feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s-6); align-items: center; }
  .work-card--feature .work-card__media { aspect-ratio: 16/10; margin-bottom: 0; }
  .work-card--feature h3 { font-size: var(--t-3xl); }
}

/* ---------- 11. CAPABILITIES ---------- */
.cap-grid { display: grid; gap: var(--s-6); }
@media (min-width: 720px) { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cap-grid { grid-template-columns: repeat(3, 1fr); } }
.cap { border-top: 2px solid var(--ink); padding-top: var(--s-4); }
.cap h3 { font-family: var(--f-body); font-size: var(--t-base); font-weight: 700; letter-spacing: .02em; margin-bottom: var(--s-3); }
.cap p { font-size: var(--t-sm); color: var(--muted); margin: 0; line-height: 1.6; }

/* ---------- 12. PULL QUOTE / TESTIMONIALS ---------- */
.quote { border-left: 3px solid var(--accent); padding-left: var(--s-5); }
.quote blockquote { margin: 0 0 var(--s-4); font-family: var(--f-display); font-size: var(--t-xl); line-height: 1.45; }
.quote cite { font-style: normal; font-size: var(--t-sm); color: var(--muted); display: block; line-height: 1.5; }
.quote cite b { display: block; color: var(--ink); font-weight: 700; }
.quote-grid { display: grid; gap: var(--s-7); }
@media (min-width: 820px) { .quote-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 13. CASE STUDY ---------- */
.cs-hero { padding-block: var(--s-7) var(--s-6); border-bottom: 1px solid var(--rule); }
.cs-meta { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
@media (min-width: 760px) { .cs-meta { grid-template-columns: repeat(4, 1fr); } }
.cs-meta dt { font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: var(--s-2); }
.cs-meta dd { margin: 0; font-size: var(--t-sm); line-height: 1.5; }

.cs-block { padding-block: var(--s-7); border-bottom: 1px solid var(--rule); }
.cs-block:last-of-type { border-bottom: 0; }
.cs-layout { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .cs-layout { grid-template-columns: 200px 1fr; gap: var(--s-7); } }
.cs-layout__label { font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.sample-grid { display: grid; gap: var(--s-5); margin-top: var(--s-5); }
@media (min-width: 720px) { .sample-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .sample-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.sample figure { margin: 0; }
.sample img { border: 1px solid var(--rule); background: var(--white); box-shadow: var(--shadow); }
.sample figcaption { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-3); line-height: 1.5; }

.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.result-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: baseline; margin: 0; }
.result-list b { font-family: var(--f-display); font-size: var(--t-2xl); color: var(--accent); line-height: 1; }

/* ---------- 14. RESUME ---------- */
.cv-row { display: grid; gap: var(--s-4); padding-block: var(--s-6); border-bottom: 1px solid var(--rule); }
@media (min-width: 860px) { .cv-row { grid-template-columns: 260px 1fr; gap: var(--s-7); } }
.cv-row__when { font-size: var(--t-sm); color: var(--muted); }
.cv-row__when b { display: block; color: var(--ink); font-size: var(--t-base); font-family: var(--f-display); font-weight: 600; margin-bottom: var(--s-1); }
.cv-row h3 { font-family: var(--f-display); font-size: var(--t-xl); margin-bottom: var(--s-1); }
.cv-row__role { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s-4); }
.cv-row ul { padding-left: 1.1em; }
.cv-row li { font-size: var(--t-sm); line-height: 1.6; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.tag-list li { font-size: var(--t-sm); border: 1px solid var(--rule); padding: 5px 10px; margin: 0; background: var(--white); }

/* ---------- 15. CONTACT ---------- */
.contact-grid { display: grid; gap: var(--s-7); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }
.field { margin-bottom: var(--s-5); }
.field label { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: var(--s-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: var(--t-base);
  padding: var(--s-3); border: 1.5px solid var(--rule); border-radius: var(--radius);
  background: var(--white); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 150px; resize: vertical; }
.field .hint { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-2); }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { border-bottom: 1px solid var(--rule); padding-block: var(--s-4); margin: 0; }
.contact-list a { font-family: var(--f-display); font-size: var(--t-xl); text-decoration: none; }
.contact-list a:hover { color: var(--accent); }
.contact-list span { display: block; font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: var(--s-1); }

/* ---------- 16. FOOTER ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: var(--s-8) var(--s-6); margin-top: var(--s-8); }
.footer-grid { display: grid; gap: var(--s-6); }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-7); } }
.site-footer h2 { font-family: var(--f-display); font-size: var(--t-2xl); margin-bottom: var(--s-4); }
.site-footer a { color: var(--paper); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--s-3); }
.footer-heading { font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-3); font-weight: 600; margin-bottom: var(--s-4); }
.footer-bottom { border-top: 1px solid rgba(247,243,236,.22); margin-top: var(--s-7); padding-top: var(--s-5); font-size: var(--t-sm); color: var(--paper-3); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; }

/* ---------- 17. MOTION (respects reduced-motion) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 18. PRINT ---------- */
@media print {
  .site-header, .site-footer, .btn, .nav-toggle, body::before { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1rem; }
  a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
