/* =========================================================================
   aarav.me  ·  Washi (V4 prototype)
   "a quiet cream-paper notebook, with one small playful seal."
   Soft Japanese editorial. Ink, but kept loose.
   ========================================================================= */

:root {
  /* Palette — oat milk cream, warm ink, dusty blush, one cinnabar seal. */
  --cream:        #F4EDD8;
  --cream-deep:   #ECE3CA;
  --cream-warm:   #F8F2E0;
  --ink:          #2A241D;
  --ink-soft:     #4A4137;
  --ink-muted:    #9B9080;
  --rule:         #DBD3BD;
  --rule-soft:    rgba(42, 36, 29, 0.08);

  --blush:        #C97A8C;   /* the soft accent — dusty pink */
  --blush-deep:   #A85F70;
  --seal:         #B83A2C;   /* cinnabar — used ONLY on the hanko seal */
  --seal-soft:    rgba(184, 58, 44, 0.92);

  /* Type — variable serif primary, Klee One for JP ornaments, mono for coords. */
  --serif-fraunces:    'Fraunces', 'Iowan Old Style', 'Times New Roman', serif;
  --serif-instrument:  'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --serif-garamond:    'EB Garamond', 'Iowan Old Style', 'Times New Roman', serif;
  --serif:             var(--serif-fraunces);
  --jp:                'Klee One', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --mono:              'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --measure: 64ch;
  --container: 680px;

  /* Motion — soft ease-out, like ink soaking. The opposite of stepped. */
  --soft-in:  200ms ease-out;
  --soft-out: 160ms ease-out;
}

html[data-font="instrument"] { --serif: var(--serif-instrument); }
html[data-font="garamond"]   { --serif: var(--serif-garamond); }

/* =========================================================================
   RESET
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum", "ss01";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(to right, var(--blush), var(--blush));
  background-position: 0 100%;
  background-size: 100% 1px;
  background-repeat: no-repeat;
  padding-bottom: 1.5px;
  transition: color var(--soft-in), background-size var(--soft-in);
}
a:hover, a:focus-visible {
  color: var(--blush-deep);
  background-size: 100% 1.5px;
}
a:focus-visible {
  outline: 1.5px dotted var(--blush);
  outline-offset: 3px;
}

/* Japanese characters — Klee One, slightly larger optical balance */
.jp {
  font-family: var(--jp);
  font-weight: 400;
  font-feature-settings: "palt" 1;
}

/* =========================================================================
   WASHI GRAIN — fiber-textured paper, slightly more present than V2/V3
   ========================================================================= */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.75 0.92' numOctaves='2' stitchTiles='stitch' seed='6'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0 0.11  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}

/* Soft cream halo at the top — like light through rice paper */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 49;
  background:
    radial-gradient(ellipse at 50% -20%,
      var(--cream-warm) 0%,
      transparent 60%);
  opacity: 0.7;
}

/* =========================================================================
   HEADER — small wordmark + hiragana subtitle
   ========================================================================= */

.header {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: none;
  padding-bottom: 0;
}
.wordmark:hover { color: var(--blush-deep); background: none; }

.wordmark__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.wordmark__sub .jp {
  font-family: var(--jp);
  font-size: 13px;
  letter-spacing: 0;
  margin-right: 2px;
  color: var(--ink-soft);
}
.wordmark__en { text-transform: lowercase; }

/* =========================================================================
   CONTAINER
   ========================================================================= */

.container {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 56px 32px 24px;
  position: relative;
  z-index: 1;
}

/* =========================================================================
   HERO
   ========================================================================= */

.hero { margin-bottom: 48px; }

.hero__pre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 22px;
}
.hero__pre .jp {
  font-family: var(--jp);
  font-size: 16px;
  color: var(--blush);
  font-style: normal;
}

.hero__line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 28px;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.hero__line em {
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
}

.hero__body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 56ch;
  text-wrap: pretty;
}

/* =========================================================================
   BRUSH DIVIDER — SVG path, ink-stroke feel
   ========================================================================= */

.brush {
  display: block;
  width: 100%;
  height: 14px;
  max-width: var(--container);
  margin: 56px auto;
  color: var(--ink-muted);
  opacity: 0.55;
}

.brush--footer {
  margin: 48px auto 24px;
}

/* =========================================================================
   BLOCK — section heading: ※ English / 日本語
   ========================================================================= */

.block { padding: 0; }

.block__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 28px;
  font-variation-settings: "opsz" 28;
}

.block__mark {
  font-family: var(--jp);
  font-style: normal;
  color: var(--blush);
  font-size: 22px;
  line-height: 1;
}

.block__jp {
  font-family: var(--jp);
  font-style: normal;
  font-size: 16px;
  color: var(--ink-muted);
  letter-spacing: 0;
  margin-left: 4px;
}

/* =========================================================================
   WORK LIST
   ========================================================================= */

.work {
  display: flex;
  flex-direction: column;
  counter-reset: workrow;
}

.work__row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 6px 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.work__row:last-child { border-bottom: 0; }

.work__num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.work__main { min-width: 0; }

.work__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.012em;
  line-height: 1.25;
  margin-bottom: 4px;
  font-variation-settings: "opsz" 24;
}
.work__name a {
  color: var(--ink);
  background: none;
  padding-bottom: 0;
}
.work__name a:hover { color: var(--blush-deep); background: none; }

.work__desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.work__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   MORE — small inline link, e.g. "All work →"
   ========================================================================= */

.more {
  margin-top: 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
}
.more a {
  color: var(--blush);
  background-image: linear-gradient(to right, var(--blush-deep), var(--blush-deep));
  background-size: 0% 1px;
}
.more a:hover {
  color: var(--blush-deep);
  background-size: 100% 1px;
}
.more .jp {
  font-family: var(--jp);
  font-style: normal;
}

/* =========================================================================
   ESSAYS — writing entries
   ========================================================================= */

.essays { display: flex; flex-direction: column; }

.essay {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 4px 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.essay:last-child { border-bottom: 0; }

.essay__date {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

.essay__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.012em;
  line-height: 1.3;
  margin-bottom: 4px;
  font-variation-settings: "opsz" 24;
}
.essay__title em { font-style: italic; }
.essay__title a {
  color: var(--ink);
  background: none;
  padding-bottom: 0;
}
.essay__title a:hover { color: var(--blush-deep); background: none; }

.essay__lede {
  grid-column: 2 / -1;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

@media (max-width: 520px) {
  .essay {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .essay__lede { grid-column: 1 / -1; }
}

/* =========================================================================
   ABOUT
   ========================================================================= */

.about {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: start;
}

.about__plate { margin: 4px 0 0; }
.about__plate img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  padding: 4px;
  background: var(--cream-warm);
  filter: contrast(0.95) saturate(0.85);
}

.about__body p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 52ch;
}
.about__body p:last-of-type { margin-bottom: 24px; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.links a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--blush);
  background: none;
  padding-bottom: 0;
}
.links a:hover { color: var(--blush-deep); }

@media (max-width: 520px) {
  .about {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .about__plate { width: 96px; }
}

/* =========================================================================
   FOOTER — brush + signature seal
   ========================================================================= */

.footer {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 56px;
  position: relative;
  z-index: 1;
}

.signoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.signoff__text { flex: 1; min-width: 200px; }

.signoff__loc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}

.signoff__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-transform: lowercase;
}
.signoff__meta .jp {
  font-family: var(--jp);
  font-size: 13px;
  color: var(--ink-soft);
}

/* The hanko seal. Cinnabar, tilted, slightly worn. */
.seal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--seal-soft);
  color: var(--cream);
  font-family: var(--jp);
  font-size: 38px;
  line-height: 1;
  border: 3px solid var(--seal);
  border-radius: 2px;
  transform: rotate(-5deg);
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 1px rgba(244, 237, 216, 0.15),
    1px 1px 0 0 rgba(42, 36, 29, 0.08);
  transition: transform var(--soft-in);
}
.seal:hover { transform: rotate(-2deg) scale(1.03); }

.seal__char {
  font-family: var(--jp);
  font-weight: 600;
  padding-top: 3px;
  letter-spacing: 0;
  text-shadow:
    0 0 1px rgba(244, 237, 216, 0.4);
}

/* slight ink-worn texture on the seal */
.seal::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='r'><feTurbulence type='turbulence' baseFrequency='1.6' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.72  0 0 0 0 0.23  0 0 0 0 0.17  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23r)'/></svg>");
  mix-blend-mode: lighten;
  opacity: 0.55;
  pointer-events: none;
}

/* =========================================================================
   TYPE TOGGLE
   ========================================================================= */

.type-toggle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 7px 10px;
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  z-index: 100;
  border-radius: 2px;
}

.type-toggle__label {
  color: var(--ink-muted);
  padding-right: 10px;
  margin-right: 4px;
  border-right: 1px solid var(--rule);
}

.type-toggle button {
  color: var(--ink-muted);
  padding: 4px 7px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color var(--soft-in);
}
.type-toggle button:hover { color: var(--ink); }
.type-toggle button[aria-pressed="true"] { color: var(--blush-deep); }

@media (max-width: 560px) {
  .type-toggle {
    bottom: 12px;
    right: 12px;
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* =========================================================================
   SELECTION
   ========================================================================= */

::selection {
  background: var(--blush);
  color: var(--cream);
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================================
   PRINT
   ========================================================================= */

@media print {
  body::before, body::after, .type-toggle, .brush { display: none; }
  body { background: white; color: black; }
  a { color: black; background: none; }
  .seal { transform: none; }
}
