/* ============================================================
   Aporia Phonetic Group
   The site of a holding company that does not need to impress you.
   ============================================================ */

:root {
  --paper:        #F4EFE3;  /* sheet of laid paper */
  --paper-edge:   #E8E1D2;
  --desk:         #E2D9C3;  /* darker writing surface beneath the sheet */
  --ink:          #1A1A18;
  --ink-soft:     #4A4742;
  --ink-faint:    #8A857C;
  --accent:       #1B2A4E;  /* registry navy — used for hover/focus only */
  --accent-soft:  #2E3B5C;
  --gilt:         #8A6E36;  /* aged brass for the ornament */
  --gilt-soft:    #B59653;
  --rule:         #BFB39C;  /* fine engraved rule */
  --rule-faint:   #D5CAB2;  /* paired hairline */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "EB Garamond", "Adobe Garamond Pro", Garamond, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "onum" 1, "kern" 1, "liga" 1, "dlig" 1;
}

/* Always reserve scrollbar space so the centered frame sits in the same place on every page */
html { scrollbar-gutter: stable; }

/* The room: subtle vignetting on the desk itself, not on the paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,250,235,0.35) 0, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(60,40,15,0.18) 0, transparent 70%);
  z-index: 0;
}

/* ---------- Page frame: the sheet itself ---------- */

.frame {
  position: relative;
  max-width: 780px;
  margin: 40px auto;
  padding: 72px 80px 64px;
  background: var(--paper);
  /* Engraved double-rule: inner hair + paper gap + outer hair */
  border: 0.5px solid var(--rule);
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 6.5px var(--rule-faint),
    /* the sheet lifts almost imperceptibly off the desk */
    0 1px 0 rgba(60, 45, 20, 0.10),
    0 18px 40px -22px rgba(50, 35, 10, 0.20);
  z-index: 1;
}

/* Faint laid-paper texture INSIDE the sheet only */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0, transparent 7px,
      rgba(120, 95, 55, 0.018) 7px, rgba(120, 95, 55, 0.018) 8px
    ),
    radial-gradient(ellipse at 20% 10%, rgba(255, 245, 220, 0.35) 0, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(110, 85, 50, 0.05) 0, transparent 55%);
  mix-blend-mode: multiply;
  z-index: 0;
}
.frame > *:not(.watermark) { position: relative; z-index: 1; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .frame { margin: 20px 14px; padding: 44px 28px 40px; }
}

/* ---------- Masthead (inner pages only — return-to-home mark) ---------- */

.masthead {
  display: flex;
  justify-content: center;
  padding-bottom: 28px;
}

.masthead .mark {
  font-family: "Cinzel", "Trajan Pro", "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.42em;
  color: var(--ink);
  text-decoration: none;
  padding-left: 0.42em;
  transition: opacity .2s ease;
}
.masthead .mark:hover { opacity: .65; }

/* ---------- Typography ---------- */

h1, h2, h3, .display {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.eyebrow {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--ink-faint);
  margin: 0 0 18px;
}

.page-title {
  font-family: "EB Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  line-height: 1.15;
  margin: 0 0 8px;
}

@media (max-width: 640px) {
  .page-title { font-size: 30px; }
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
p.lead { font-size: 20.5px; line-height: 1.55; }

/* Drop cap + run-in small caps for opening paragraphs */
.dropcap {
  float: left;
  font-family: "EB Garamond", serif;
  font-weight: 500;
  font-size: 5.2em;
  line-height: 0.86;
  margin: 0.05em 0.10em 0 -0.03em;
  color: var(--ink);
  font-feature-settings: "lnum" 1, "kern" 1;
}
.lead-caps {
  font-variant: small-caps;
  font-feature-settings: "smcp" 1, "onum" 1;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.note {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 17px;
}

.fine {
  font-size: 14.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* Body content fills the frame — matches the rule width */
.measure, .measure-wide, .holding .status, .note { max-width: none; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
  position: relative;
}
/* Paired hairline below the main rule — engraved double-rule between sections */
hr.rule::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 0.5px solid var(--rule-faint);
}

/* Top rule — paired with the crest, equal gap above & below */
hr.rule-top {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

hr.rule-short {
  border: 0;
  border-top: 1px solid var(--rule);
  width: 64px;
  margin: 36px 0;
}

/* ---------- The Crest ---------- */

.crest {
  text-align: center;
  margin: 0;
  user-select: none;
}

.crest .ornament {
  display: block;
  margin: 0 auto 26px;
  width: 280px;
  height: 22px;
  color: var(--gilt);
  opacity: 0.95;
}

.monogram-wrap {
  position: relative;
  display: inline-block;
  padding: 6px 14px;
  text-decoration: none;
  color: inherit;
}

.monogram {
  font-family: "Cinzel", "Trajan Pro", serif;
  font-weight: 500;
  font-size: 92px;
  letter-spacing: 0.18em;
  color: var(--ink);
  padding-left: 0.18em;
  line-height: 1;
  display: inline-block;
  /* Letterpress: hint of impression on the paper */
  text-shadow:
    0 1px 0 rgba(255, 248, 232, 0.55),
    0 -0.5px 0 rgba(0, 0, 0, 0.03);
}

/* The ghost — visible only on sustained hover */
.monogram.ghost {
  position: absolute;
  inset: 6px 14px 6px 14px;
  color: var(--ink);
  filter: url(#apg-signal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease-in 1s;
}

.monogram-wrap:hover .ghost {
  opacity: 0.55;
}

/* On leave, ghost fades fast (no delay) */
.monogram.ghost {
  transition: opacity 0.4s ease-out 0s;
}
.monogram-wrap:hover .ghost {
  transition: opacity 2s ease-in 1s;
}

.crest .wordmark {
  margin-top: 26px;
  font-family: "Cinzel", "Cormorant Garamond SC", serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.42em;
  color: var(--ink);
  padding-left: 0.42em;
}

.crest .established {
  margin: 18px auto 0;
  max-width: none;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 17.5px;
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .crest { margin-top: 56px; }
  .monogram { font-size: 68px; }
  .crest .wordmark { font-size: 11.5px; letter-spacing: 0.36em; }
}

/* ---------- Watermark (landing only) ---------- */

.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
.watermark svg {
  width: 75%;
  height: auto;
  color: var(--ink);
  opacity: 0.028;
}

/* ---------- Holdings entries ---------- */

.holding {
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--paper-edge);
}
.holding:last-of-type { border-bottom: 0; }

.holding h3 {
  font-family: "EB Garamond", serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: 0.005em;
}
.holding h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.holding h3 a:hover { border-bottom-color: var(--rule); }

.holding .class {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16.5px;
  margin: 0 0 10px;
}

.holding .status {
  font-size: 16.5px;
  color: var(--ink);
  margin: 0;
}

.holding .status .label {
  font-family: "Cinzel", serif;
  font-size: 10.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 8px;
}

/* ---------- Form (Registry) ---------- */

.registry-form {
  margin-top: 36px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 36px 0 32px;
}

.field {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-edge);
}
.field:last-of-type { border-bottom: 0; }

.field label {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input[type="text"],
.field input[type="email"],
.field textarea,
.field select {
  font-family: inherit;
  font-size: 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 4px 0 6px;
  width: 100%;
  outline: none;
  transition: border-color .2s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-bottom-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* Custom segmented category picker */
.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.category-row label.opt {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 8px 16px 8px 0;
  margin: 0;
  color: var(--ink-faint);
  cursor: pointer;
  border: 0;
  background: transparent;
  transition: color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.category-row label.opt::before {
  content: "";
  width: 8px; height: 8px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: inline-block;
  transition: background .2s ease, border-color .2s ease;
}
.category-row input[type="radio"] { display: none; }
.category-row input[type="radio"]:checked + label.opt { color: var(--ink); }
.category-row input[type="radio"]:checked + label.opt::before {
  background: var(--accent);
  border-color: var(--accent);
}

.submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-submit {
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 13px 26px 12px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.btn-submit:hover { background: var(--ink); color: var(--paper); }

.confirmation {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 36px;
  padding: 56px 24px;
  text-align: center;
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  line-height: 1.55;
}
.confirmation .seal {
  display: block;
  margin: 0 auto 22px;
  width: 56px;
  height: 56px;
  color: var(--accent);
}

@media (max-width: 640px) {
  .field { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .field label { font-size: 10.5px; }
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-size: 11px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
}
.bottom-nav::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 3px;
  border-top: 0.5px solid var(--rule-faint);
}

.bottom-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 22px;
  position: relative;
  transition: color .2s ease;
}
.bottom-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  background: var(--gilt);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.bottom-nav a:hover { color: var(--ink); }
.bottom-nav a.is-current { color: var(--ink); }

@media (max-width: 640px) {
  .bottom-nav { gap: 4px 0; }
  .bottom-nav a { padding: 4px 14px; font-size: 10.5px; letter-spacing: 0.26em; }
}

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

.colophon {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* Small printer's seal in the footer */
.colophon .seal-mark {
  display: block;
  margin: 0 auto 8px;
  width: 22px;
  height: 22px;
  color: var(--gilt);
  opacity: 0.85;
}

.colophon a {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.colophon a:hover { color: var(--ink); border-bottom-color: var(--rule); }

.colophon .copyright {
  font-family: "Cinzel", serif;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.colophon .stray {
  font-style: italic;
  font-size: 13px;
  max-width: 64ch;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .colophon { margin-top: 24px; }
}

/* ---------- Utility ---------- */

.center { text-align: center; }
.muted { color: var(--ink-soft); }
.measure { max-width: none; }
.measure-wide { max-width: none; }

/* Avoid blue link defaults inside paragraphs that should look like body */
p a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule); }
p a:hover { border-bottom-color: var(--accent); }
