/* ---------- Base: reset, tokens, typography, header, footer, buttons ---------- */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --ink: #17140F;
  --ink-2: #4A453D;
  --muted: #7E776C;
  --line: #E7E2D9;
  --line-2: #F0ECE4;
  --accent: #9E5A34;
  --sand: #F4EFE6;
  --radius: 16px;
  --radius-lg: 24px;
  --serif: 'Playfair Display', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --container: 1160px;
  --pad: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(.22, .72, .24, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }
h1, h2, h3, h4 { font-weight: 400; }
::selection { background: #EFE1D5; }

.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
.narrow { max-width: 720px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 250, 248, .84);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--ink); display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px; letter-spacing: .04em;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.brand:hover .brand-mark { background: var(--ink); color: #fff; }
.brand-text { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; }
.brand-dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }

.nav-link {
  position: relative; padding: 6px 0; text-decoration: none;
  font-size: 13px; letter-spacing: .03em; color: var(--ink-2);
  transition: color .3s var(--ease);
}
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 50%; background: transparent; cursor: pointer;
  padding: 0; place-items: center; gap: 5px; flex-direction: column;
}
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; left: 0; right: 0; top: 76px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 4px var(--pad) 22px;
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-link { padding: 15px 0; font-size: 15px; border-bottom: 1px solid var(--line-2); }
  .nav-link::after { display: none; }
  .nav-link.is-active { color: var(--accent); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; letter-spacing: .01em; text-decoration: none;
  cursor: pointer; background: none; color: inherit;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2C2620; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-danger { border-color: #E5C9C0; color: #9E3B21; background: #FCF3F0; }
.btn-danger:hover { border-color: #9E3B21; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 46px 38px; margin-top: clamp(48px, 8vw, 96px); }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px 48px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-name { font-family: var(--serif); font-size: 18px; }
.footer-role { font-size: 13px; color: var(--muted); max-width: 30ch; }
.footer-social { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-social a {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .3s var(--ease);
}
.footer-social a:hover { color: var(--ink); }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12.5px; color: var(--muted); }
.footer-meta a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); transition: color .3s var(--ease), border-color .3s var(--ease); }
.footer-meta a:hover { color: var(--ink); border-color: var(--ink); }

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; }
  .footer-meta { align-items: flex-start; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  transform: translate(-50%, 18px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 22px;
  border-radius: 999px; font-size: 13.5px; max-width: min(90vw, 420px);
  box-shadow: 0 18px 40px -24px rgba(23, 20, 15, .8);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #8E2F17; }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
