/* ==========================================================================
   Sharon Vered — design tokens
   ========================================================================== */
:root {
  /* Color */
  --bg: #FAFAF8;          /* near-neutral white page */
  --surface: #FFFFFF;
  --blush: #F6E8EA;       /* light pink: use sparingly */
  --stone: #F0EEEC;       /* neutral fill for image placeholders */
  --ink: #211C1A;         /* primary text */
  --muted: #6E6561;       /* secondary text */
  --rule: #E7E3E0;        /* hairlines */
  --rose: #B4566E;        /* brand accent */
  --rose-deep: #93405A;   /* accent hover / pressed */

  /* Type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-xs: 0.8125rem;   /* 13 */
  --text-sm: 0.9375rem;   /* 15 */
  --text-base: 1.0625rem; /* 17 */
  --text-lg: 1.25rem;     /* 20 */
  --text-xl: 1.75rem;     /* 28 */
  --text-2xl: clamp(2.25rem, 4vw, 3rem);
  --text-3xl: clamp(3rem, 7vw, 5.25rem);

  /* Space (8px base) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --s-8: 8rem;

  --radius: 6px;
  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 var(--s-2); }
ul { margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg); padding: var(--s-1) var(--s-2);
}
.skip:focus { left: var(--s-2); z-index: 10; }

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

/* ==========================================================================
   Type helpers
   ========================================================================== */
.display {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  letter-spacing: -0.01em;
}
.h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
}
.h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.15;
}
.lead { font-size: var(--text-lg); line-height: 1.55; color: var(--ink); }
.muted { color: var(--muted); }

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rose);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s var(--ease);
}
.text-link:hover { color: var(--rose); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  min-height: 72px;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.625rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.wordmark:hover { color: var(--rose); }
.nav { display: flex; gap: clamp(1rem, 2.6vw, 2.25rem); list-style: none; }
.nav a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding-block: 0.25rem;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--rose);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--rose); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--rose); border-color: var(--rose); }
.btn--ghost:hover { border-color: var(--rose); color: var(--rose); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: clamp(3rem, 6vw, 4.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section--blush { background: var(--blush); }
.section--after-hero { padding-top: clamp(1rem, 2vw, 1.5rem); }
.section + .section:not(.section--blush) { border-top: 1px solid var(--rule); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-2); flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.page-head { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: var(--s-4); }
.page-head p { max-width: 60ch; margin-top: var(--s-3); }

/* Fade-in for section headings (only when JS is available) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Image placeholders — drop real files into /images and they replace the box
   ========================================================================== */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--stone);
  border-radius: var(--radius);
  aspect-ratio: 3 / 2;
}
.ph::before {
  content: attr(data-file);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: var(--s-2);
  text-align: center;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ph img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ph--portrait { aspect-ratio: 4 / 5; }
.ph--square { aspect-ratio: 1 / 1; }
/* Screenshots sit on a neutral mat so they read as deliberate */
.ph--mat img {
  inset: 8%;
  width: 84%; height: 84%;
  object-fit: cover; object-position: left top;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(33 28 26 / .06), 0 8px 24px rgb(33 28 26 / .08);
}

/* ==========================================================================
   Home
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 7fr 4fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
}
.hero .lead { max-width: 34ch; margin: var(--s-3) 0 var(--s-4); font-size: clamp(1.25rem, 2vw, 1.5rem); }

/* Rotating phrase in the hero */
.rotator { display: block; margin-top: 0.35rem; min-height: 1.3em; }
.rotator-word {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  line-height: 1.2;
  color: var(--ink);
  border-bottom: 2px solid var(--rose);
  padding-bottom: 0.05em;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.rotator-word.is-out { opacity: 0; transform: translateY(8px); }

/* Skill pills: two rows drifting in opposite directions */
.marquees { display: grid; gap: var(--s-2); }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  list-style: none;
  animation: marquee 60s linear infinite;
}
.marquee--reverse .marquee-track { animation-direction: reverse; animation-duration: 45s; }
.marquee-track li {
  margin-right: var(--s-2);
  padding: 0.75rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--text-base);
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

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

/* ==========================================================================
   Project cards
   ========================================================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5) var(--s-4);
}
.card { display: flex; flex-direction: column; }
.card .ph { transition: transform .3s var(--ease); }
.card-body {
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
  transition: border-color .3s var(--ease);
}
.card-title { font-family: var(--font-display); font-size: 1.625rem; line-height: 1.15; }
.card-org { margin: 0.25rem 0 0; font-size: var(--text-sm); color: var(--muted); }
.card-desc { margin: 0.5rem 0 0; font-size: var(--text-sm); color: var(--muted); }
.card:hover .ph { transform: translateY(-4px); }
.card:hover .card-body { border-top-color: var(--rose); }
.card:hover .card-title { color: var(--rose-deep); }

/* ==========================================================================
   Places map (home)
   ========================================================================== */
.map-hint { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.map-hint-phone { display: none; }
.map { position: relative; }
.map-canvas { position: relative; aspect-ratio: 1200 / 379.3; }
.map-base { position: absolute; inset: 0; width: 100%; height: 100%; }

.pin {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 1;
}
.pin::before {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2.5px var(--surface), 0 2px 6px rgb(33 28 26 / .25);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.pin:hover::before, .pin:focus-visible::before { transform: scale(1.25); background: var(--rose-deep); }
.pin[aria-expanded="true"] { z-index: 2; }
.pin[aria-expanded="true"]::before { transform: scale(1.35); background: var(--rose-deep); }
.pin:focus-visible { outline: none; }
.pin:focus-visible::before { outline: 2px solid var(--rose); outline-offset: 4px; }

/* Where I'm headed: hollow pin with a soft pulse */
.pin--next::before { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--rose), 0 2px 6px rgb(33 28 26 / .2); }
.pin--next:hover::before, .pin--next[aria-expanded="true"]::before { background: var(--blush); }
.pin--next::after {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--rose);
  animation: pin-pulse 2.4s var(--ease) infinite;
}
@keyframes pin-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }

.pin-label {
  position: absolute;
  bottom: calc(100% - 4px); left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.pin:hover .pin-label, .pin:focus-visible .pin-label { opacity: 1; transform: translate(-50%, 0); }
.pin[aria-expanded="true"] .pin-label { opacity: 0; }

.map-card {
  position: absolute;
  z-index: 3;
  width: 280px;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--rose);
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgb(33 28 26 / .05), 0 12px 32px rgb(33 28 26 / .12);
  animation: card-in .2s var(--ease);
}
.map-card[hidden] { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
.map-card-tag {
  margin: 0 0 0.2rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose);
}
.map-card-name { font-family: var(--font-display); font-size: 1.625rem; line-height: 1.15; padding-right: 1.5rem; }
.map-card-desc { margin: 0.4rem 0 0; font-size: var(--text-sm); line-height: 1.55; color: var(--muted); }
.map-card-close {
  position: absolute; top: 0.4rem; right: 0.45rem;
  width: 28px; height: 28px;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.map-card-close:hover { color: var(--rose); background: var(--blush); }


/* ==========================================================================
   About
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about-intro .ph { width: 120px; margin-bottom: var(--s-3); }
.about-intro h1 { margin-bottom: var(--s-3); }
.about-intro p { color: var(--ink); }

.photo-set + .photo-set { margin-top: var(--s-4); }
.photo-set > p { margin-bottom: var(--s-2); }
.photo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.photo-row figure { margin: 0; }
.photo-row figcaption { margin-top: 0.5rem; font-size: var(--text-xs); color: var(--muted); }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.two-col h2 { margin-bottom: var(--s-2); }
.spotify { width: 100%; height: 352px; border: 0; border-radius: 12px; }
.curious { list-style: none; border-top: 1px solid var(--rule); }
.curious li { padding-block: 0.8rem; border-bottom: 1px solid var(--rule); }
.curious li::before { content: "—"; color: var(--rose); margin-right: 0.75rem; }

/* ==========================================================================
   Resume
   ========================================================================== */
.cv-section {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--s-4);
  padding-block: var(--s-5);
  border-top: 1px solid var(--rule);
}
.cv-section > h2 { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.2; }
.cv-entry + .cv-entry { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.cv-entry-head { display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.cv-org { font-weight: 600; }
.cv-meta { font-size: var(--text-sm); color: var(--muted); text-align: right; }
.cv-role { display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.cv-role h3 { font-family: var(--font-body); font-size: var(--text-base); font-weight: 500; font-style: italic; }
.cv-list { margin-top: 0.5rem; padding-left: 1.1rem; max-width: 70ch; }
.cv-list li { margin-bottom: 0.35rem; }
.cv-list li::marker { color: var(--rose); }
.cv-dl { display: grid; grid-template-columns: 200px 1fr; gap: 0.75rem var(--s-3); margin: 0; }
.cv-dl dt { font-weight: 500; }
.cv-dl dd { margin: 0; color: var(--ink); }

/* ==========================================================================
   Thoughts + Connect
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 4rem);
  display: grid;
  gap: var(--s-3);
  justify-items: start;
}
.panel p { max-width: 52ch; margin: 0; }
.panel .panel-statement {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.15;
}

.connect {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.link-list { list-style: none; border-top: 1px solid var(--rule); margin-top: var(--s-4); }
.link-list a {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: var(--s-2);
  align-items: baseline;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link-list a:hover { color: var(--rose); border-bottom-color: var(--rose); }
.link-list .label { display: inline-flex; align-items: center; gap: 0.6em; font-weight: 500; }
.link-list .dest { color: var(--muted); overflow-wrap: anywhere; }
.link-list a:hover .dest { color: var(--rose); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--rule); padding-block: var(--s-5) var(--s-4); }
.footer-inner { display: grid; gap: var(--s-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); list-style: none; }
.footer-links a { display: inline-flex; align-items: center; gap: 0.5em; text-decoration: none; font-weight: 500; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--rose); }
.footer-note { font-size: var(--text-xs); color: var(--muted); margin: var(--s-3) 0 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about, .connect { grid-template-columns: 1fr; }
  .cv-section { grid-template-columns: 1fr; gap: var(--s-3); }
}

@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.25rem; padding-block: 0.85rem; min-height: 0; }
  .wordmark { font-size: 1.5rem; }
  .nav { gap: 1.1rem; flex-wrap: wrap; }
  .nav a { font-size: var(--text-xs); }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 280px; }
  .two-col { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .photo-row { gap: 0.5rem; }
  .link-list a { grid-template-columns: 1fr; gap: 0.15rem; }
  .link-list .dest { font-size: var(--text-sm); }
  .cv-meta { text-align: left; }
  .cv-dl { grid-template-columns: 1fr; gap: 0.25rem; }
  .cv-dl dd { margin-bottom: var(--s-2); }
  /* Pins sit close together on a phone: shrink them and show the card under the map */
  .map-hint-wide { display: none; }
  .map-hint-phone { display: inline; }
  /* Too narrow to tell the U.S. pins apart: let the map run wider and swipe sideways */
  .map-scroll {
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .map-scroll::-webkit-scrollbar { display: none; }
  .map-canvas { width: 860px; }
  .pin { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
  .pin::before, .pin--next::after { inset: 7px; }
  .pin-label { display: none; }
  .map-card { position: relative; top: auto !important; left: auto !important; width: auto; margin-top: var(--s-2); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; width: auto; flex-wrap: wrap; row-gap: var(--s-2); padding-inline: var(--gutter); }
  .marquee-track li[aria-hidden="true"] { display: none; }
}

/* Link icons */
.icon { width: 1.1em; height: 1.1em; flex: none; }
