/* ==========================================================================
   eputnam77.github.io - "Marked Up"
   A portfolio about document review, set like a document under review.
   Accent = proofreader red. Rules = hairlines. Emphasis = change bars.
   ========================================================================== */

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --paper:      #FAF8F3;
  --paper-sunk: #F1ECE1;
  --paper-card: #FFFDF9;

  --ink:        #17130F;
  --ink-80:     rgba(23, 19, 15, 0.80);
  --ink-60:     rgba(23, 19, 15, 0.60);
  --ink-42:     rgba(23, 19, 15, 0.42);
  --ink-16:     rgba(23, 19, 15, 0.16);
  --ink-08:     rgba(23, 19, 15, 0.08);

  --mark:       #BE3A21;
  --mark-soft:  rgba(190, 58, 33, 0.10);
  --mark-line:  rgba(190, 58, 33, 0.34);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans:  "Public Sans", "Helvetica Neue", Helvetica, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 104px;
  --measure: 68ch;

  --ease: cubic-bezier(0.2, 0.7, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #14120F;
    --paper-sunk: #1D1A16;
    --paper-card: #1A1714;

    --ink:        #F2EDE4;
    --ink-80:     rgba(242, 237, 228, 0.80);
    --ink-60:     rgba(242, 237, 228, 0.58);
    --ink-42:     rgba(242, 237, 228, 0.40);
    --ink-16:     rgba(242, 237, 228, 0.16);
    --ink-08:     rgba(242, 237, 228, 0.08);

    --mark:       #E9704F;
    --mark-soft:  rgba(233, 112, 79, 0.12);
    --mark-line:  rgba(233, 112, 79, 0.40);
  }
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* Paper grain - a single inline SVG, no network request. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before { opacity: 0.06; }
}

/* ---- Skip link ----------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.65rem 1rem;
  font-family: var(--mono);
  font-size: 13px;
}
.skip:focus { left: 0; }

/* ---- Shell --------------------------------------------------------------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

/* The asymmetric spec layout: mono margin, then content. */
.spread {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 0 clamp(20px, 4vw, 44px);
}

@media (max-width: 720px) {
  .spread { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Marginalia ---------------------------------------------------------- */
.margin-note {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-42);
  padding-top: 0.55rem;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .margin-note { padding-top: 0; margin-bottom: 0.5rem; }
}

/* ---- Masthead ------------------------------------------------------------ */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.6rem 0 1.4rem;
  border-bottom: 1px solid var(--ink-16);
}

.masthead__id {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.masthead__id b { font-weight: 500; }
.masthead__id:hover { color: var(--mark); }

.masthead nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.masthead nav a { color: var(--ink-60); text-decoration: none; }
.masthead nav a:hover { color: var(--mark); }

/* ---- Type ---------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
}

.display {
  font-size: clamp(2.6rem, 7.2vw, 5.1rem);
  line-height: 1.02;
  margin: 0 0 1.1rem;
}
.display em {
  font-style: italic;
  color: var(--mark);
}

h2.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.12;
  margin: 0 0 1rem;
}

h3 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 0.5rem; }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-80);
  max-width: 46ch;
  margin: 0 0 1.6rem;
}

p { max-width: var(--measure); }
.prose p + p { margin-top: 1rem; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--mark-line);
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--mark); text-decoration-color: var(--mark); }

/* ---- Change bar: the emphasis device from controlled documents ----------- */
.changebar {
  border-left: 2px solid var(--mark);
  padding-left: clamp(1rem, 2.5vw, 1.6rem);
}

/* ---- Sections ------------------------------------------------------------ */
.band {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-top: 1px solid var(--ink-16);
}
.band--open { border-top: 0; padding-top: clamp(3rem, 8vw, 6rem); }

/* ---- Buttons ------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.72rem 1.1rem;
  border: 1px solid var(--ink-16);
  color: var(--ink);
  background: transparent;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn--mark { border-color: var(--mark); color: var(--mark); }
.btn--mark:hover { background: var(--mark); border-color: var(--mark); color: var(--paper); }
.btn__arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---- Project index ------------------------------------------------------- */
.index { list-style: none; margin: 0; padding: 0; }
.entry { border-top: 1px solid var(--ink-16); }
.entry:last-child { border-bottom: 1px solid var(--ink-16); }

.entry__link {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr) auto;
  gap: 0 clamp(20px, 4vw, 44px);
  align-items: start;
  padding: clamp(1.6rem, 3.4vw, 2.4rem) 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s var(--ease);
}
.entry__link:hover { background: var(--mark-soft); }

@media (max-width: 720px) {
  .entry__link { grid-template-columns: minmax(0, 1fr); }
}

.entry__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1;
  color: var(--ink-42);
  transition: color 0.3s var(--ease);
}
.entry__link:hover .entry__num { color: var(--mark); }

@media (max-width: 720px) {
  .entry__num { margin-bottom: 0.35rem; }
}

.entry__name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.1;
  margin: 0 0 0.45rem;
  display: inline-block;
  background-image: linear-gradient(var(--mark), var(--mark));
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease);
}
.entry__link:hover .entry__name { background-size: 100% 1.5px; }

.entry__what {
  color: var(--ink-60);
  margin: 0 0 0.85rem;
  max-width: 56ch;
  font-size: 16px;
}

.entry__go {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-42);
  white-space: nowrap;
  padding-top: 0.6rem;
  transition: color 0.3s var(--ease);
}
.entry__link:hover .entry__go { color: var(--mark); }

@media (max-width: 720px) {
  .entry__go { display: none; }
}

/* ---- Tags ---------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  border: 1px solid var(--ink-16);
  padding: 0.28rem 0.5rem;
}
.tag--live { color: var(--mark); border-color: var(--mark-line); }
.tag--live::before { content: "\25CF\0020"; font-size: 8px; vertical-align: 1px; }

/* ---- Spec table ---------------------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.8rem 1rem 0.8rem 0;
  border-bottom: 1px solid var(--ink-08);
}
.spec-table th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-42);
  width: 34%;
}
.spec-table td { color: var(--ink-80); }
.spec-table a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--mark-line);
  text-underline-offset: 3px;
}
.spec-table a:hover { color: var(--mark); }

.table-scroll { overflow-x: auto; }

/* ---- Capability list ----------------------------------------------------- */
.caps { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.4rem; }

@media (min-width: 860px) {
  .caps { grid-template-columns: 1fr 1fr; gap: 1.6rem 2.6rem; }
}

.caps h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mark);
  margin: 0 0 0.35rem;
}
.caps p { margin: 0; color: var(--ink-80); font-size: 16px; max-width: 46ch; }

/* ---- Code ---------------------------------------------------------------- */
pre {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  background: var(--paper-sunk);
  border: 1px solid var(--ink-08);
  border-left: 2px solid var(--mark);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  margin: 0 0 1rem;
  max-width: 100%;
}
pre code { font: inherit; color: var(--ink-80); }
pre .c { color: var(--ink-42); }

:not(pre) > code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--mark-soft);
  padding: 0.1em 0.35em;
}

/* ---- Callout ------------------------------------------------------------- */
.note {
  font-size: 15px;
  color: var(--ink-60);
  background: var(--paper-sunk);
  border-left: 2px solid var(--ink-16);
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0 0;
  max-width: 62ch;
}
.note strong { color: var(--ink); font-weight: 600; }
.note a { color: var(--ink); text-decoration-color: var(--mark-line); }

/* ---- Flow diagram (text-native, crawlable) ------------------------------- */
.flow {
  font-family: var(--mono);
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
}
.flow li { display: flex; align-items: center; gap: 0.75rem; }
.flow li:not(:last-child)::after { content: "\2192"; color: var(--mark); }

/* ---- Screenshot ------------------------------------------------------------ */
.shots {
  display: grid;
  gap: 1.1rem;
  margin: 0;
}

@media (min-width: 860px) {
  .shots--2 { grid-template-columns: 1fr 1fr; }
}

.shot {
  margin: 0;
  border: 1px solid var(--ink-16);
  background: var(--paper-card);
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-60);
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--ink-16);
}

/* ---- Footer -------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--ink-16);
  padding: 2.4rem 0 3rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-42);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  justify-content: space-between;
}
.foot a { color: var(--ink-60); text-decoration: none; }
.foot a:hover { color: var(--mark); }

/* ---- Entrance choreography ---------------------------------------------- */
/* The hidden state lives in the keyframes, never in the rule itself. If
   animations are disabled, unsupported, or fail to start, the content still
   renders at full opacity instead of vanishing. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.85s var(--ease) both; }

  [data-d="1"] { animation-delay: 0.06s; }
  [data-d="2"] { animation-delay: 0.14s; }
  [data-d="3"] { animation-delay: 0.22s; }
  [data-d="4"] { animation-delay: 0.30s; }
  [data-d="5"] { animation-delay: 0.38s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}

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