/* ---------- Font ---------- */
@font-face {
  font-family: 'Fraunces Variable';
  src: url('fonts/fraunces-variable.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root{
  --bg:      #F7EFE2;
  --ink:     #2B2018;
  --ink-soft:#6E5A47;
  --accent:    #6F4630;
  --accent-deep:#4C2F1F;
  --clay:    #C1663D;
  --card:    #EBDDC4;
  --line:    rgba(43,32,24,.16);

  --serif: 'Fraunces Variable', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --gap: clamp(1.5rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]){
    --bg:      #20160F;
    --ink:     #F3E7D6;
    --ink-soft:#C9AD91;
    --accent:    #CB9066;
    --accent-deep:#E0AC80;
    --clay:    #E2915C;
    --card:    #2C2019;
    --line:    rgba(243,231,214,.16);
  }
}

/* Manual overrides via the theme toggle — win regardless of system preference */
html[data-theme="dark"]{
  --bg:      #20160F;
  --ink:     #F3E7D6;
  --ink-soft:#C9AD91;
  --accent:    #CB9066;
  --accent-deep:#E0AC80;
  --clay:    #E2915C;
  --card:    #2C2019;
  --line:    rgba(243,231,214,.16);
}
html[data-theme="light"]{
  --bg:      #F7EFE2;
  --ink:     #2B2018;
  --ink-soft:#6E5A47;
  --accent:    #6F4630;
  --accent-deep:#4C2F1F;
  --clay:    #C1663D;
  --card:    #EBDDC4;
  --line:    rgba(43,32,24,.16);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ color-scheme: light dark; overflow-x: hidden; }
body{
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }

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

/* ---------- Theme toggle ---------- */
.theme-toggle{
  position: fixed;
  top: clamp(1rem, 3vw, 1.5rem);
  right: clamp(1rem, 3vw, 1.5rem);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.theme-toggle:hover{ border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg{ width: 19px; height: 19px; }

/* default (light, or system-light-with-no-override): show moon, offer switch to dark */
.theme-toggle .icon-sun{ display: none; }
.theme-toggle .icon-moon{ display: block; }

/* system prefers dark, and no manual override forcing light: show sun, offer switch to light */
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) .theme-toggle .icon-sun{ display: block; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon{ display: none; }
}

/* manual overrides always win */
html[data-theme="dark"] .theme-toggle .icon-sun{ display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display: none; }
html[data-theme="light"] .theme-toggle .icon-sun{ display: none; }
html[data-theme="light"] .theme-toggle .icon-moon{ display: block; }

/* ---------- Layout ---------- */
.wrap{
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(1.5rem, 5vw, 4rem);
}

.hero{
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

/* soft ambient glow, one deliberate accent behind the text */
.hero::before{
  content: "";
  position: absolute;
  top: 50%; left: 8%;
  width: 420px; height: 420px;
  transform: translateY(-50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: .14;
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}

.hero-text{ max-width: 46ch; }

/* ---------- 404 page ---------- */
.wrap.not-found{ align-items: center; text-align: center; }
.not-found-content{ max-width: 40ch; }
.not-found-content .location{ justify-content: center; }
.not-found-content .btn-secondary{ margin-top: .4rem; }

.location{
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.25rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

h1{
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 .6rem;
}

.role{
  font-family: var(--serif);
  font-weight: 460;
  font-style: italic;
  color: var(--accent);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin: 0 0 1.1rem;
}

.bio{
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 1.8rem;
}

.cta-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .9rem;
  margin-bottom: 1.6rem;
  --cta-h: 56px;
}

.btn-primary{
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  height: var(--cta-h);
  background: var(--accent);
  color: var(--bg);
  padding: 0 1.5rem 0 .4rem;
  border-radius: 999px;
  transition: background .2s ease, transform .2s ease;
}
.avatar{
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid var(--bg);
  background: var(--card);
}
.btn-copy{
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.btn-label{ font-weight: 600; font-size: .95rem; }
.btn-handle{ font-weight: 400; opacity: .85; font-size: .82em; }
.btn-primary:hover{ background: var(--accent-deep); transform: translateY(-2px); }

.btn-secondary{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  height: var(--cta-h, 52px);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 0 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.btn-secondary svg{ flex: none; }
.btn-secondary:hover{
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

.links{
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.pill{
  border: 1px solid var(--line);
  padding: .5rem 1rem;
  border-radius: 999px;
  font-size: .88rem;
  white-space: nowrap;
  color: var(--ink-soft);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pill:hover{
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---------- Bento photo grid ---------- */
.bento{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  aspect-ratio: 1 / 1;
}
.tile{
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}
.tile img{
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.92);
  transition: transform .5s ease, filter .5s ease;
}
.tile:hover img{
  transform: scale(1.06);
  filter: saturate(1.05);
}

.tile-a{ grid-column: 1 / 3; grid-row: 1 / 3; border-radius: 22px; }
.tile-b{ grid-column: 3 / 5; grid-row: 1 / 2; border-radius: 12px; }
.tile-c{ grid-column: 3 / 5; grid-row: 2 / 4; border-radius: 16px; }
.tile-d{ grid-column: 1 / 2; grid-row: 3 / 4; border-radius: 10px; }
.tile-e{ grid-column: 2 / 3; grid-row: 3 / 4; border-radius: 18px; }

/* ---------- Footer ---------- */
.foot{
  margin-top: clamp(2rem, 6vw, 4rem);
  color: var(--ink-soft);
  font-size: .85rem;
}
.foot p{ margin: 0; }
.foot a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line);
}
.foot a:hover{ color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- Motion (one entrance moment) ---------- */
@keyframes rise{
  from{ opacity: 0; transform: translateY(16px); }
  to{ opacity: 1; transform: none; }
}
.hero-text{ animation: rise .7s ease-out both; }
.bento{ animation: rise .7s ease-out .12s both; }

@media (prefers-reduced-motion: reduce){
  .hero-text, .bento{ animation: none; }
  .tile img, .btn-primary, .btn-secondary, .pill, .theme-toggle{ transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 840px){
  .wrap{
    min-height: auto;
    justify-content: flex-start;
    padding-block: 4.25rem 4.5rem;
  }
  .hero{
    grid-template-columns: 1fr;
  }
  .hero-text{ max-width: none; order: 1; }
  .bento{ order: 2; aspect-ratio: 4 / 3; }
  .hero::before{ left: 50%; transform: translate(-50%, -50%); }
}

@media (max-width: 480px){
  .bento{
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    aspect-ratio: 3 / 4;
  }
  .tile-a{ grid-column: 1 / 3; grid-row: 1 / 2; }
  .tile-b{ grid-column: 1 / 2; grid-row: 2 / 3; }
  .tile-c{ grid-column: 2 / 3; grid-row: 2 / 4; }
  .tile-d{ grid-column: 1 / 2; grid-row: 3 / 4; }
  .tile-e{ display: none; }
}
