/* ============================================================
   elithullen.com — thinkpad · polymath · poetcore
   Dot-grid paper (Leuchtturm1917), ink, one red TrackPoint dot.
   ============================================================ */

:root {
  /* paper */
  --paper: #f6f1e5;        /* warm ivory, LT1917 cream */
  --paper-deep: #efe8d8;   /* slight vignette tone */
  --grid-dot: #c9c1ac;     /* the 5mm dot grid */

  /* ink */
  --ink: #26241f;          /* soft iron-gall black */
  --ink-faint: #6f6a5c;    /* pencil annotations */

  /* the accent */
  --trackpoint: #c1121f;   /* ThinkPad red */

  --serif: "EB Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --script: "Caveat", cursive;

  --grid: 26px;            /* dot spacing */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background-color: var(--paper);
  /* dot grid + a faint vignette so the page reads as paper, not flat color */
  background-image:
    radial-gradient(circle at center, var(--grid-dot) 1.1px, transparent 1.4px),
    radial-gradient(ellipse 120% 90% at 50% 0%, var(--paper) 60%, var(--paper-deep) 100%);
  background-size: var(--grid) var(--grid), 100% 100%;
  background-position: calc(var(--grid) / 2) calc(var(--grid) / 2), 0 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 2rem) 4rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- header marginalia ---------- */

.margin-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink-faint);
}

.margin-note .dot {
  flex: 1;
  border-bottom: 1px dotted var(--grid-dot);
  transform: translateY(2px);
}

/* ---------- signature hero ---------- */

.hero {
  text-align: center;
  padding: clamp(3rem, 10vh, 6rem) 0 clamp(2rem, 6vh, 3.5rem);
}

.signature {
  display: block;
  width: min(460px, 84vw);
  margin: 0 auto;
  /* melt the photo's paper background into the page */
  mix-blend-mode: multiply;
  filter: contrast(1.25) brightness(1.08) saturate(0.85);
  transform: rotate(-2deg);
}

.signature-fallback {
  display: none; /* shown by onerror if assets/signature.png is missing */
  font-family: var(--script);
  font-size: clamp(4rem, 13vw, 6rem);
  line-height: 1;
  transform: rotate(-3deg);
  color: #2d2a63; /* ballpoint blue-black */
}

/* ---------- socials ---------- */

.socials {
  margin-top: 2.25rem;
  display: flex;
  justify-content: center;
  gap: clamp(0.9rem, 3vw, 1.4rem);
}

.socials a {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  color: var(--ink);
  transition: color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.socials svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--trackpoint);
  background-color: rgba(193, 18, 31, 0.07);
  transform: translateY(-2px);
  outline: none;
}

/* ---------- index (the links) ---------- */

.index {
  margin-top: clamp(1.5rem, 5vh, 3rem);
}

.index-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.index-title::after {
  content: "";
  display: block;
  margin-top: 0.6rem;
  border-bottom: 1px solid var(--ink);
}

.entries {
  list-style: none;
}

.entry {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.95rem 0.25rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px dotted var(--grid-dot);
  transition: padding-left 140ms ease;
}

.entry-name {
  font-size: 1.25rem;
  font-weight: 500;
}

.entry-leader {
  flex: 1;
  border-bottom: 1px dotted var(--grid-dot);
  transform: translateY(-4px);
}

.entry-page {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

a.entry:hover,
a.entry:focus-visible {
  padding-left: 0.75rem;
  outline: none;
}

a.entry:hover .entry-name,
a.entry:focus-visible .entry-name {
  color: var(--trackpoint);
}

.entry--soon {
  color: var(--ink-faint);
}

.soon-tag {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--grid-dot);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-left: 0.5rem;
  vertical-align: 0.2em;
}

/* ---------- colophon ---------- */

.colophon {
  margin-top: auto;
  padding-top: 4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  line-height: 2;
}

/* A ThinkPad TrackPoint "soft rim" cap: domed red nub with the classic
   concave dish top and dimpled rubber texture. */
.trackpoint {
  --tp: 22px;
  display: inline-block;
  width: var(--tp);
  height: var(--tp);
  border-radius: 50%;
  margin-bottom: 0.9rem;
  background:
    /* dimpled cap texture */
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.28) 0 0.7px, transparent 1.3px)
      0 0 / 4px 4px,
    /* concave dish: brighter rim, shaded center */
    radial-gradient(circle at 50% 40%, #8a0c15 0%, #b3121d 30%, #d8202c 52%, #e5454e 68%, #9d0f18 88%, #6d0910 100%);
  background-blend-mode: soft-light, normal;
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.3),
    inset 0 -2px 3px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ---------- writing ---------- */

/* the home link in the header marginalia */
.margin-note a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

.margin-note a:hover,
.margin-note a:focus-visible {
  color: var(--trackpoint);
}

.piece {
  margin-top: clamp(2.5rem, 8vh, 4.5rem);
}

.piece-title {
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.piece-meta {
  margin-top: 0.9rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The reading column. Line height snaps to the dot grid so body text
   sits on the ruling, like writing in the notebook itself. */
.prose {
  margin-top: 2.25rem;
  font-size: 1.19rem;
  line-height: var(--grid);
}

.prose > * + * { margin-top: var(--grid); }

.prose h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: calc(var(--grid) * 2);
}

.prose h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: calc(var(--grid) * 1.5);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--trackpoint);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 120ms ease;
}

.prose a:hover,
.prose a:focus-visible { color: var(--trackpoint); }

.prose blockquote {
  border-left: 2px solid var(--trackpoint);
  padding-left: 1.25rem;
  font-style: italic;
  color: var(--ink-faint);
}

.prose ul,
.prose ol { padding-left: 1.5rem; }
.prose li { margin-top: calc(var(--grid) / 2); }

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(38, 36, 31, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose pre {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: rgba(38, 36, 31, 0.05);
  border: 1px solid var(--grid-dot);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
}

.prose pre code { background: none; padding: 0; }

.prose hr {
  border: none;
  border-top: 1px dotted var(--grid-dot);
}

.prose img {
  max-width: 100%;
  height: auto;
}

/* dates in the writing index shouldn't be cramped */
.entry-page time { white-space: nowrap; }

/* ---------- portfolio ---------- */

/* Project rows stack a blurb under the leader line, so they need to be
   a column rather than the single baseline row a plain entry uses. */
.entry--project {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.entry-row {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.entry-blurb {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 46ch;
}

a.entry--project:hover .entry-blurb,
a.entry--project:focus-visible .entry-blurb {
  color: var(--ink);
}

.meta-sep { margin: 0 0.6rem; opacity: 0.5; }

.project-cover {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2.25rem;
  border: 1px solid var(--grid-dot);
  border-radius: 3px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: calc(var(--grid) * 1.5);
}

.project-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--grid-dot);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.project-links a:hover,
.project-links a:focus-visible {
  color: var(--trackpoint);
  border-color: var(--trackpoint);
  background-color: rgba(193, 18, 31, 0.06);
}

.empty-note {
  color: var(--ink-faint);
  font-style: italic;
  padding: 1rem 0;
}

.back {
  display: inline-block;
  margin-top: 3.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 120ms ease;
}

.back::before {
  content: "\2190";
  margin-right: 0.5rem;
}

.back:hover,
.back:focus-visible { color: var(--trackpoint); }

/* ---------- a11y ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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