/* davistown.com/card — echoes the printed card: warm white, Garamond, quiet. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif JP";
  src: url("/fonts/noto-serif-jp-subset.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FAFAF7;
  --ink: #181818;
  --soft: #66665f;
  --rule: #cfcfc8;
  --serif: "EB Garamond", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", Georgia, serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 24rem;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 4rem;
}

[hidden] { display: none !important; }

[lang="ja"] { font-weight: 500; letter-spacing: 0.04em; }

/* ── name block ───────────────────────────────────────────── */
.who { text-align: center; margin-bottom: 2.5rem; }

/* Two columns, one per word: the English word with its katakana reading centred beneath it. */
h1 {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.1rem;
  margin: 0;
  font-size: 1rem;
  font-weight: inherit;
}
h1 .word { display: flex; flex-direction: column; align-items: center; }
h1 .en {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.094em;
  margin-right: -0.094em; /* tracking adds a trailing gap; pull it back so each word centres on its ink */
}
h1 .kana {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  white-space: nowrap;
}

/* ── buttons ──────────────────────────────────────────────── */
.links { display: grid; gap: 0.75rem; }

.btn {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.btn [lang="ja"] { margin-left: 0.6em; font-size: 0.85em; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.brand { display: flex; align-items: center; justify-content: center; gap: 0.7rem; }
.btn.brand img { display: block; flex: none; }
.btn:disabled { opacity: 0.5; cursor: default; }

@media (hover: hover) {
  .btn:hover { background: var(--ink); color: var(--paper); }
  .btn.brand:hover { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
  .btn.primary:hover { opacity: 0.85; }
}

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

/* ── form ─────────────────────────────────────────────────── */
section { margin-top: 3.25rem; }

h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  text-wrap: balance;
}
h2 [lang="ja"], .lede [lang="ja"], .notice [lang="ja"] { display: block; }
h2 [lang="ja"] { margin-top: 0.3rem; font-size: 0.9rem; font-weight: 500; }

.lede {
  margin: 0.6rem 0 2rem;
  text-align: center;
  color: var(--soft);
}
.lede [lang="ja"], .notice [lang="ja"] { font-size: 0.82em; margin-top: 0.15rem; }

.field { margin: 0 0 1.6rem; padding: 0; border: 0; min-width: 0; }

label, legend {
  display: block;
  padding: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
label > [lang="ja"], legend > [lang="ja"] {
  display: block;
  font-size: 0.8rem;
  color: var(--soft);
}

input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem; /* ≥16px: stops iOS zooming on focus */
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:focus-visible { outline: none; border-bottom-width: 2px; padding-bottom: calc(0.45rem - 1px); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.chip { position: relative; margin: 0; flex: 1 1 auto; } /* chips stretch, so every row runs edge to edge */
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip > span {
  display: block;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip > span [lang="ja"] { margin-left: 0.3em; font-size: 0.76rem; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#turnstile:not(:empty) { margin-bottom: 1rem; }

.status { min-height: 1.5rem; margin: 0.9rem 0 0; text-align: center; }
.status [lang="ja"] { display: block; font-size: 0.82em; }

.notice {
  margin: 0.6rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  color: var(--soft);
  text-wrap: balance;
}

#thanks { text-align: center; }
#thanks:focus { outline: none; }
#thanks .links { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── owner's release page ─────────────────────────────────── */
.owner main { padding-top: 3rem; }
.details { margin: 1.75rem 0 2rem; }
.details dt { font-size: 0.85rem; letter-spacing: 0.03em; color: var(--soft); }
.details dd { margin: 0 0 0.9rem; overflow-wrap: anywhere; }
textarea {
  display: block;
  width: 100%;
  margin: 0.4rem 0 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  resize: vertical;
}

/* ── wider screens ────────────────────────────────────────── */
/* Tablet and small laptop: the same single column, with more air. */
@media (min-width: 600px) {
  main { max-width: 27rem; padding-top: 7rem; padding-bottom: 6rem; }
  h1 .en { font-size: 2rem; }
  h1 .kana { font-size: 1.05rem; }
}

/* Desktop: the name and LinkedIn on the left, the form on the right, centred in the window. */
@media (min-width: 960px) {
  body:not(.owner) main {
    display: grid;
    grid-template-columns: minmax(0, 24rem) minmax(0, 26rem);
    grid-template-areas: "who form" "links form";
    grid-template-rows: 1fr 1fr;
    column-gap: clamp(4rem, 9vw, 9rem);
    justify-content: center;
    align-content: center;
    max-width: 72rem;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 4rem 3rem;
  }
  body:not(.owner) .who { grid-area: who; align-self: end; margin-bottom: 2.75rem; }
  body:not(.owner) nav.links { grid-area: links; align-self: start; width: 100%; max-width: 20rem; justify-self: center; }
  body:not(.owner) #share, body:not(.owner) #thanks { grid-area: form; align-self: center; margin-top: 0; }
  h1 { gap: 1.4rem; }
  h1 .en { font-size: 2.5rem; }
  h1 .kana { font-size: 1.2rem; margin-top: 0.7rem; }
}

/* ── contact page (a released link) ───────────────────────── */
.contact .details a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.contact .details dt [lang="ja"] { margin-left: 0.4em; }
.contact .links { margin-top: 1rem; }

/* ── release page: the visit ──────────────────────────────── */
.visit-h { margin: 2rem 0 0; font-size: 1rem; font-weight: 600; letter-spacing: 0.03em; color: var(--soft); text-align: left; }
.details.visit dd { font-size: 0.95rem; }
.details a { color: var(--ink); text-underline-offset: 0.2em; }
