/* ---------------------------------------------------------------
   PK40.net — Posta Kutusu 40
   A mailbox with a door left open.
   --------------------------------------------------------------- */

:root {
  /* Paper palette */
  --paper:        #f4eddf;
  --paper-light:  #faf6ec;
  --paper-edge:   #c9beac;
  --rule:         #d6cab5;

  /* Ink palette */
  --ink:          #1c1612;
  --ink-soft:     #3a302a;
  --ink-faded:    #6b5e51;
  --ink-ghost:    #9a8f81;

  /* Accents */
  --link:         #34608d;     /* faded blue */
  --link-visited: #6a4a82;     /* dusty violet */
  --link-hover:   #b04a26;     /* sealing wax */

  /* Status pill tints (background / text) */
  --status-active-bg:      #d8e3d4;  --status-active-fg:      #2f4d2c;
  --status-archived-bg:    #d9d3c6;  --status-archived-fg:    #4a4338;
  --status-sleeping-bg:    #d8d3df;  --status-sleeping-fg:    #443d57;
  --status-transferred-bg: #ead9be;  --status-transferred-fg: #6a4a1a;
  --status-held-bg:        #d6dcc6;  --status-held-fg:        #45502c;
  --status-wip-bg:         #ead4cf;  --status-wip-fg:         #7a3522;
}

/* ---------- reset (light) ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — a single radial vignette, no texture image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 20%, transparent 60%, rgba(120, 95, 60, 0.07) 100%),
    radial-gradient(ellipse at 70% 80%, transparent 60%, rgba(120, 95, 60, 0.06) 100%);
  z-index: -1;
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  font-family: "Iowan Old Style", "Charter", "Georgia", serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0 0 1.1em;
}

p.lede {
  font-size: 1.1rem;
}

em, i { font-style: italic; }
strong, b { font-weight: 600; color: var(--ink); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(52, 96, 141, 0.35);
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a:visited { color: var(--link-visited); }
a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

hr.ornament {
  border: none;
  text-align: center;
  margin: 2.5rem 0;
  height: 1em;
}
hr.ornament::before {
  content: "·   ·   ·";
  color: var(--ink-ghost);
  letter-spacing: 0.6em;
  font-size: 1.1rem;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--paper-edge);
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- layout shell ---------- */

.shell {
  max-width: 38rem;          /* a column of text */
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

.shell--wide {
  max-width: 52rem;          /* directory needs more room */
}

/* ---------- header / nav ---------- */

.masthead {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.2rem;
}

.masthead__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.15em;
}
.masthead__title a {
  color: var(--ink);
  text-decoration: none;
}
.masthead__title a:hover { color: var(--link-hover); }

.masthead__sub {
  font-style: italic;
  color: var(--ink-faded);
  font-size: 0.95rem;
  margin: 0 0 0.9rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
.nav a {
  color: var(--ink-faded);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  padding-bottom: 1px;
}
.nav a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- homepage hero ---------- */

.hero {
  margin-bottom: 2.5rem;
}
.hero h1 {
  margin-bottom: 0.1em;
}
.hero h2 {
  margin-bottom: 1.5rem;
}

/* Drop the first letter on the opening paragraph */
.opening::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.9;
  padding: 0.05em 0.12em 0 0;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- directory cards ---------- */

.directory {
  display: grid;
  gap: 2.2rem;
  margin-top: 2rem;
}

.entry {
  background: var(--paper-light);
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  padding: 1.6rem 1.7rem 1.4rem;
  position: relative;
  box-shadow: 0 1px 0 rgba(120, 95, 60, 0.06);
}

.entry__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 0.4rem;
}

.entry__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.entry__name {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
}

.entry__tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  margin-left: auto;
  white-space: nowrap;
}

.entry__tag--archived    { background: var(--status-archived-bg);    color: var(--status-archived-fg); }
.entry__tag--active      { background: var(--status-active-bg);      color: var(--status-active-fg); }
.entry__tag--sleeping    { background: var(--status-sleeping-bg);    color: var(--status-sleeping-fg); }
.entry__tag--transferred { background: var(--status-transferred-bg); color: var(--status-transferred-fg); }
.entry__tag--held        { background: var(--status-held-bg);        color: var(--status-held-fg); }
.entry__tag--wip         { background: var(--status-wip-bg);         color: var(--status-wip-fg); }

.entry__sub {
  font-style: italic;
  color: var(--ink-faded);
  margin: 0 0 1rem;
  font-size: 0.98rem;
}

.entry__body p {
  margin-bottom: 0.9em;
}
.entry__body p:last-child {
  margin-bottom: 0;
}

.entry__link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-faded);
  text-decoration: none;
}
.entry__link::before {
  content: "→ ";
  color: var(--ink-ghost);
}
.entry__link:hover {
  color: var(--link-hover);
}

/* ---------- footer ---------- */

.footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-faded);
  font-style: italic;
  text-align: center;
}
.footer p { margin: 0; }

/* ---------- 404 ---------- */

.lost {
  text-align: center;
  padding: 5rem 1.5rem;
  max-width: 32rem;
  margin: 0 auto;
}
.lost__number {
  font-size: 4rem;
  letter-spacing: 0.1em;
  margin: 0 0 0.4rem;
  color: var(--ink-ghost);
  font-weight: 500;
}
.lost h1 {
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 1.2rem;
}
.lost p {
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 540px) {
  body { font-size: 17px; }
  .shell { padding: 2.2rem 1.2rem 4rem; }
  h1 { font-size: 1.9rem; }
  .entry { padding: 1.3rem 1.3rem 1.1rem; }
  .entry__tag { margin-left: 0; }
  .opening::first-letter {
    font-size: 2.6rem;
  }
}

@media (prefers-color-scheme: dark) {
  /* Keep the paper aesthetic even in dark mode — soften, don't invert */
  :root {
    --paper:        #1d1a16;
    --paper-light:  #25211c;
    --paper-edge:   #3a342c;
    --rule:         #3a342c;
    --ink:          #e9dfcd;
    --ink-soft:     #c8bca7;
    --ink-faded:    #968a76;
    --ink-ghost:    #6c6155;
    --link:         #88b3d8;
    --link-visited: #b39bd0;
    --link-hover:   #e2906d;
  }
  body::before {
    background:
      radial-gradient(ellipse at 30% 20%, transparent 60%, rgba(0, 0, 0, 0.25) 100%),
      radial-gradient(ellipse at 70% 80%, transparent 60%, rgba(0, 0, 0, 0.25) 100%);
  }
}
