/* Juliana Smith portfolio. Brand: warm cream, dark purple text, yellow accents. WCAG 2.2 AA. */
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --cream: #fdf8ec;
  --cream-deep: #f6eedb;
  --white: #ffffff;
  --ink: #1f1f1f;
  --purple: #221a33;
  --purple-soft: #4a4062;
  --yellow: #eeba2b;
  --yellow-soft: #f8e3a1;
  --peach: #f9dcc4;
  --line: #d9ccb0;
  --radius: 18px;
  --radius-media: 5px;
  --shadow: 0 1px 2px rgba(34, 26, 51, 0.08), 0 8px 24px rgba(34, 26, 51, 0.08);
  --nav-h: 4.5rem;
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; scroll-padding-top: calc(var(--nav-h) + 1rem); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--purple);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 0.6em; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--purple); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 0.09em; }
a:hover { text-decoration-thickness: 0.18em; }

/* Focus: dark purple outline with yellow inner ring, visible on cream, white and yellow */
:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--yellow);
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--purple); color: var(--cream); padding: 0.75rem 1.25rem; border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

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

.wrap { width: min(1180px, 100% - 3rem); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--cream);
  border-bottom: 1px solid var(--line); min-height: var(--nav-h);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-h); gap: 1rem; }
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; padding: 0.5rem 0; }
.nav-toggle {
  display: none; min-width: 44px; min-height: 44px; padding: 0.5rem 1rem; font: inherit; font-weight: 600;
  background: var(--white); color: var(--purple); border: 2px solid var(--purple); border-radius: 999px; cursor: pointer;
}
.nav-list { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-list a {
  display: inline-block; padding: 0.6rem 0.9rem; min-height: 44px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 1rem;
}
.nav-list a:hover { background: var(--yellow-soft); }
.nav-list a[aria-current="true"] { background: var(--yellow); color: var(--ink); }

@media (max-width: 62em) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-list {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cream);
    flex-direction: column; align-items: stretch; padding: 0.75rem 1.25rem 1.25rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-list.open { display: flex; }
  .nav-list a { display: block; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0.75rem 1.6rem;
  font: inherit; font-weight: 700; font-size: 1.05rem; border-radius: 999px; border: 2px solid var(--purple); cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-primary:hover { background: #f5c844; border-color: #f5c844; }
.btn-outline { background: transparent; color: var(--purple); }
.btn-outline:hover { background: var(--yellow-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.5rem; }

/* Sections */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; position: relative; }
.alt { background: var(--cream-deep); }
.eyebrow { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--purple-soft); margin: 0 0 0.75rem; }
.lead { font-size: 1.3rem; color: var(--purple); }
.bio p { font-size: 1.2rem; max-width: 68ch; }
.wave { display: block; width: 100%; height: 56px; position: absolute; left: 0; top: -55px; }
.wave path { fill: var(--cream-deep); }
.wave.to-cream path { fill: var(--cream); }

/* Hero */
.hero { padding-top: clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.portrait { position: relative; max-width: 420px; justify-self: center; width: 100%; }
.portrait::before {
  content: ""; position: absolute; inset: 6% 4% 0 4%; background: var(--yellow); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
}
.portrait img { position: relative; width: 100%; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; order: -1; }
}

/* Cards */
.grid { display: grid; gap: 1.25rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-projects { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.card { background: var(--white); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); border: 1px solid #efe4c9; }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.icon-badge {
  width: 56px; height: 56px; border-radius: 50%; background: var(--purple); display: grid; place-items: center; margin-bottom: 1rem;
}
.icon-badge img { width: 30px; height: 30px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; counter-reset: step; }
.steps li { background: var(--white); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); border: 1px solid #efe4c9; position: relative; }
.step-num { font-family: var(--font-head); font-weight: 800; font-size: 2.4rem; color: var(--ink); line-height: 1; display: block; margin-bottom: 0.5rem; }
.step-num::after { content: ""; display: block; width: 2.5rem; height: 6px; background: var(--yellow); border-radius: 3px; margin-top: 0.5rem; }
.steps h3 { font-size: 1.2rem; margin: 0; }

/* Projects */
.project-card { border-radius: var(--radius-media); padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid #efe4c9; background: var(--cream-deep); }
.project-body { padding: 1.4rem 1.6rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.project-kind { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--purple-soft); margin: 0 0 0.4rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.25rem 0 1.1rem; }
.tags li { background: var(--yellow-soft); color: var(--ink); border-radius: 999px; padding: 0.15rem 0.75rem; font-size: 0.9rem; font-weight: 600; }
.project-card .btn { margin-top: auto; align-self: flex-start; }
.project-card .btn::after { content: ""; position: absolute; inset: 0; } /* whole card clickable, single tab stop */
.project-card:hover { transform: translateY(-3px); }
.project-card { transition: transform 0.2s ease; }
.project-card:focus-within { border-radius: var(--radius-media); outline: 3px solid var(--purple); outline-offset: 3px; box-shadow: 0 0 0 3px var(--yellow); }
.project-card .btn:focus-visible { outline: none; box-shadow: none; }

/* Dialog */
dialog.project-dialog {
  width: min(1000px, 100% - 1.5rem); max-height: calc(100dvh - 1.5rem); padding: 0; border: 0; border-radius: var(--radius);
  background: var(--cream); color: var(--purple); box-shadow: 0 20px 60px rgba(34, 26, 51, 0.4); overflow: auto;
}
dialog.project-dialog::backdrop { background: rgba(34, 26, 51, 0.65); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.5rem 1.5rem 0; }
.dialog-head h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin: 0; }
.dialog-close { min-width: 48px; min-height: 48px; border-radius: 50%; border: 2px solid var(--purple); background: var(--white); color: var(--purple); font: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer; flex: none; line-height: 1; }
.dialog-close:hover { background: var(--yellow); }
.dialog-body { padding: 1rem 1.5rem 1.75rem; }
.gallery { margin: 0 0 1.5rem; }
.gallery-frame { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-media); overflow: hidden; }
.gallery-frame img { width: 100%; height: auto; }
.gallery-caption { margin-top: 1.25rem; }
.gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.gallery-controls .btn { min-width: 48px; padding: 0.5rem 1.1rem; }
.gallery-count { font-weight: 600; }
.alt-details { margin: 0.75rem 0 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.25rem 1rem; }
.alt-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.alt-details p { font-size: 1rem; margin-bottom: 0.9rem; }

/* Repos */
#repo-grid + p { margin-top: 1.5rem; }
.repo { display: flex; flex-direction: column; gap: 0.35rem; }
.repo h3 { margin: 0; font-size: 1.15rem; word-break: break-word; }
.repo .meta { font-size: 0.95rem; color: var(--purple-soft); margin: 0; }
.status { font-size: 1rem; color: var(--purple-soft); }

/* Contact */
.contact-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.contact-list a { display: inline-block; padding: 0.4rem 0; min-height: 44px; font-weight: 600; font-size: 1.15rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: 1rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { list-style: none; display: flex; gap: 1.25rem; padding: 0; margin: 0; flex-wrap: wrap; }
.site-footer a { display: inline-block; padding: 0.5rem 0; min-height: 44px; }

/* Scroll fade-in (JS adds .js-fade; disabled for reduced motion) */
.js-fade .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js-fade .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js-fade .reveal { opacity: 1; transform: none; }
}

/* Text spacing overrides must not clip (1.4.12): avoid fixed heights on text containers */
.prose { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.prose h2 { margin-top: 2rem; font-size: 1.7rem; }
.prose ul { padding-left: 1.2rem; max-width: 70ch; }

/* AI / product cards */
.grid-products { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); margin-top: 2rem; }
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: var(--radius-media); }
.product-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; border-bottom: 1px solid #efe4c9; background: var(--cream-deep); }
.product-card .project-body .note { font-size: 1rem; color: var(--purple-soft); }
.product-card .btn { align-self: center; width: min(100%, 18rem); margin-top: auto; text-align: center; }
.more-links { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 0.25rem; font-size: 1rem; }
.more-links a { display: inline-block; padding: 0.4rem 0; min-height: 44px; }
.product-card .note { margin-bottom: 1.25rem; }
