:root {
  --bg: #FDF6F1;
  --ink: #2C1E2A;
  --ink-2: #6B5566;
  --accent: #B03A6A;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(44, 30, 42, 0.09);
  --shadow: rgba(176, 58, 106, 0.09);
  --shadow-lift: rgba(176, 58, 106, 0.18);
  --blob-1: #FFB4A2;
  --blob-2: #C3B4F5;
  --chip: #FFFFFF;
}

html[data-theme="dark"] {
  --bg: #17111A;
  --ink: #F6ECEF;
  --ink-2: #B79FAE;
  --accent: #FF9EBB;
  --card: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-lift: rgba(0, 0, 0, 0.5);
  --blob-1: #8E4A6B;
  --blob-2: #4B3D8C;
  --chip: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Offsets anchor-scroll targets below the sticky <site-header> so the
   section heading doesn't land hidden underneath it. */
#projects, #experience, #contact { scroll-margin-top: 90px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.site { position: relative; }

/* ---------- background blobs ---------- */

/* Absolutely positioned and taken out of flow (rather than a plain
   overflow:hidden wrapper) so clipping its intentional horizontal bleed
   never touches an ancestor of the sticky <site-header> — overflow other
   than visible on ANY ancestor, even x-only, breaks position:sticky.
   Height is fixed to comfortably cover all three blobs (the tallest,
   blob-3, bottoms out around 2020px) since it can't size from its
   absolutely-positioned — and so height:auto — children. */
.blobs { position: absolute; inset: 0; height: 2050px; overflow: hidden; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
  animation: drift 20s ease-in-out infinite;
}

.blob-1 {
  top: -190px; left: -150px; width: 640px; height: 640px;
  background: radial-gradient(circle, var(--blob-1) 0%, transparent 68%);
  opacity: .85;
}

.blob-2 {
  top: 140px; right: -220px; width: 700px; height: 700px;
  background: radial-gradient(circle, var(--blob-2) 0%, transparent 68%);
  opacity: .8;
  animation-duration: 26s;
  animation-direction: reverse;
}

.blob-3 {
  top: 1500px; left: -160px; width: 520px; height: 520px;
  background: radial-gradient(circle, var(--blob-2) 0%, transparent 70%);
  opacity: .5;
  filter: blur(14px);
  animation-duration: 30s;
}

.page {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 26px;
}

/* Header (brand, nav, print button, theme toggle) is now the <site-header>
   web component — js/components/site-header.js — styles live in its shadow DOM. */

/* ---------- hero ---------- */

.hero { padding: 74px 0 44px; max-width: 920px; }

.hero-top { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }

.avatar {
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px var(--shadow);
  animation: riseIn .6s ease both;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.eyebrow {
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  animation: riseIn .6s ease .06s both;
}

.hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 7.6vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

.hero-title span {
  display: inline-block;
  animation: wordIn .7s cubic-bezier(.2, .75, .2, 1) both;
}

.hero-title .accent { color: var(--accent); }

.caret {
  display: inline-block;
  width: 0.06em;
  height: 0.82em;
  vertical-align: -0.06em;
  background: var(--accent);
  margin-left: 0.08em;
  animation: caretBlink .8s steps(1) .3s 4, caretOut .3s linear 3.5s forwards;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 28px 0 0;
  max-width: 680px;
  text-wrap: pretty;
  animation: riseIn .7s ease .16s both;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
/* Individual chips are the <contact-chip> web component —
   js/components/contact-chip.js — styles live in its shadow DOM. */

/* ---------- skills ---------- */

.skills { padding-bottom: 64px; }

.section-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 14px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 16px var(--shadow);
  cursor: default;
  animation: riseIn .5s ease both;
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease;
}
.tag:hover {
  transform: translateY(-5px) rotate(-2deg);
  box-shadow: 0 14px 26px var(--shadow-lift);
  color: var(--accent);
}
.tag:nth-child(even):hover { transform: translateY(-5px) rotate(2deg); }

/* ---------- now / learning / open to ---------- */

.now-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding-bottom: 84px;
}

/* Individual cards are the <now-card> web component —
   js/components/now-card.js — styles live in its shadow DOM. */

/* ---------- reveal-on-scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- projects ---------- */

.projects { padding-bottom: 84px; }

.projects h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 50px);
  margin: 0 0 8px;
  letter-spacing: -0.025em;
}

.section-intro {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 0 30px;
  max-width: 560px;
}

.project-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
}

/* .project-row rows are now rendered by the <project-card> web component
   (js/components/project-card.js) — its styles live in that component's
   shadow DOM. The rules below style content passed into its slot. */

/* Wraps any number of .shot-frame boxes passed into a <project-card>'s
   slot — one screenshot or several, it wraps responsively either way.
   align-items: start keeps each frame at its own photo's natural height
   instead of every frame in a row stretching to match the tallest. */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: start; }

.shot-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.shot-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* Alternative to .shot-grid for a set of screenshots that share a
   capture height but not a capture width (e.g. phone screens shot at
   different zoom levels) — sizes every frame to a common height instead
   of stretching to equal column widths, which is what actually makes
   them line up. */
.shot-row { display: flex; flex-wrap: wrap; gap: 14px; }
.shot-row .shot-frame { height: 280px; }
.shot-row .shot-frame img { width: auto; height: 100%; }

/* For a project with no screenshot yet — pass this in place of a real
   image inside a .shot-frame. */
.image-placeholder {
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  color: var(--ink-2);
  font-size: 13px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  box-sizing: border-box;
}

/* ---------- experience ---------- */

.experience { padding-bottom: 84px; }

.experience h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 50px);
  margin: 0 0 30px;
  letter-spacing: -0.025em;
}

/* .exp-card entries are now rendered by the <experience-card> web
   component (js/components/experience-card.js) — its styles live in
   that component's shadow DOM. */

/* ---------- education ---------- */

.education { padding-bottom: 84px; }

.education h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 50px);
  margin: 0 0 30px;
  letter-spacing: -0.025em;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.edu-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
}

.edu-dates { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }

.edu-card h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 6px;
  line-height: 1.25;
}

.edu-field { margin: 0; font-size: 15px; color: var(--ink-2); }

.lang-card { display: flex; gap: 36px; flex-wrap: wrap; align-items: flex-start; }
.lang-name { font-size: 18px; font-weight: 600; }
.lang-level { font-size: 13px; color: var(--ink-2); }

/* ---------- contact ---------- */

.contact { padding: 0 0 96px; }

.contact-card {
  background: linear-gradient(120deg, var(--ink), color-mix(in oklab, var(--accent) 55%, var(--ink)));
  border-radius: 32px;
  padding: clamp(30px, 5vw, 62px);
  color: var(--bg);
}

.contact-card h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 5.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.contact-card > p {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.6;
  max-width: 520px;
  opacity: .85;
}

.contact-links { display: flex; flex-wrap: wrap; gap: 12px; }

.contact-email {
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
}
.contact-email:hover { background: var(--blob-1); color: var(--ink); text-decoration: none; }

.contact-phone {
  border: 1px solid color-mix(in oklab, var(--bg) 45%, transparent);
  color: var(--bg);
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
}
.contact-phone:hover {
  border-color: var(--bg);
  background: color-mix(in oklab, var(--bg) 14%, transparent);
  color: var(--bg);
  text-decoration: none;
}

.contact-location { padding: 14px 6px; font-size: 16px; opacity: .8; }

.footer-row {
  margin-top: 34px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- animations ---------- */

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(34px, -26px) scale(1.09); }
  100% { transform: translate(0, 0) scale(1); }
}

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

@keyframes wordIn {
  from { opacity: 0; transform: translateY(0.5em) rotate(1.5deg); filter: blur(9px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes caretBlink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes caretOut {
  to { opacity: 0; width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title span { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  /* The mobile header's touch-sized (44px) buttons make the sticky bar
     taller than on desktop, so anchor targets need a bit more clearance. */
  #projects, #experience, #contact { scroll-margin-top: 100px; }

  .page { padding: 0 18px; }

  .hero { padding-top: 30px; padding-bottom: 26px; }
  .hero-top { gap: 16px; margin-bottom: 18px; }
  .avatar { width: 82px; height: 82px; }
  .hero-title { font-size: 38px; }
  .lead { font-size: 16.5px; }

  .blob { opacity: .5; filter: blur(18px); }

  .skills,
  .now-cards,
  .projects,
  .experience,
  .education { padding-bottom: 56px; }

  .projects h2,
  .experience h2,
  .education h2 { font-size: 29px; }

  .shot-row .shot-frame { height: 200px; }

  .edu-card { padding: 22px; border-radius: 22px; }

  .contact-card { border-radius: 24px; }
  .contact-card h2 { font-size: 31px; }

  .footer-row { flex-direction: column; gap: 6px; }
}

/* ---------- print ---------- */

@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-noprint] { display: none !important; }
  :root {
    --bg: #fff; --ink: #141014; --ink-2: #454045; --accent: #9B2F5C;
    --card: #fff; --line: #c9c2c7; --shadow: transparent; --shadow-lift: transparent; --chip: #fff;
  }
  body { background: #fff; }
  [data-print-tight] { padding-top: 16px !important; padding-bottom: 16px !important; }
  [data-print-break] { break-inside: avoid; page-break-inside: avoid; }
}
