/* Emulsionbook — analog photography field notebook. Warm monochrome paper, dark contact-sheet strips, orange marks. */

:root {
  --paper: #ece5d8;
  --paper-2: #e3dbcc;
  --ink: #1e1a16;
  --ink-2: #57504a;
  --rule: #c7bcaa;
  --sheet: #1b1815;
  --sheet-2: #2b2621;
  --sheet-text: #d8cfbf;
  --orange: #e0621a;
  --orange-ink: #a63a06;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
  --seam: clamp(72px, 10vw, 128px);
  --ease: 180ms ease-out;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; }

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--ink); color: var(--paper); padding: .5rem .9rem;
  font-family: var(--mono); font-size: .85rem; z-index: 10;
}
.skip:focus { top: .75rem; }

.fr { font-family: var(--mono); font-size: .75em; margin-right: .55em; color: var(--orange-ink); }

.dateline, legend, .equiv caption, .ref-grid dt {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
}
.dateline { color: var(--ink-2); margin-bottom: 1.25rem; }

/* Masthead */
.masthead {
  max-width: var(--wrap); margin: 0 auto; padding: 1.1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; }
.brand-mark { width: 14px; height: 14px; background: var(--orange); border-radius: 50%; }
.site-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-size: .95rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--orange); }
.nav-toggle {
  display: none; align-items: center; gap: .6rem; background: none; border: 1px solid var(--ink);
  font: inherit; font-size: .9rem; padding: .4rem .8rem; cursor: pointer; color: var(--ink);
}
.nav-toggle-bar {
  width: 16px; height: 2px; background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.masthead.is-open .nav-toggle-bar { box-shadow: none; transform: rotate(45deg); }

/* Section shell */
main > section, .colophon {
  max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter);
}
main > section { padding-block: var(--seam); border-bottom: 1px solid var(--rule); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.section-head .lede { margin-top: 1rem; }
.lede { font-size: 1.15rem; max-width: 58ch; color: var(--ink-2); }

/* Hero */
.hero { padding-block: clamp(3rem, 6vw, 5rem) var(--seam); }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 4.3rem); max-width: 22ch; margin-bottom: 1.1rem; }

.sheet {
  --holes: repeating-linear-gradient(90deg, transparent 0 14px, var(--sheet-2) 14px 22px, transparent 22px 30px);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  background-color: var(--sheet); color: var(--sheet-text);
  background-image: var(--holes), var(--holes);
  background-size: 100% 8px, 100% 8px; background-repeat: no-repeat;
  background-position: 0 .45rem, 0 calc(100% - .45rem);
  padding: 1.6rem 1.2rem;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem;
}

.frame {
  position: relative; text-decoration: none; color: inherit; display: block;
  transition: transform var(--ease);
}
.frame svg:first-child {
  display: block; width: 100%; aspect-ratio: 3 / 2;
  background: linear-gradient(160deg, #6a6058, #3f3833 55%, #2a2521);
  color: var(--paper); padding: 10%; border: 1px solid #4a423b;
}
.frame-no {
  position: absolute; top: .35rem; left: .4rem; font-family: var(--mono); font-size: .7rem;
  color: var(--orange); background: var(--sheet); padding: .1rem .3rem;
}
.frame-cap { display: block; margin-top: .55rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; }
.frame:hover svg:first-child, .frame:focus-visible svg:first-child { border-color: var(--orange); }
.frame:hover .frame-cap { color: var(--orange); }
.grease {
  position: absolute; inset: -5% auto auto -4%; width: 108%; color: var(--orange);
  pointer-events: none; opacity: .95;
}

/* Tabs */
.tablist { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
[role="tab"] {
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  font: inherit; font-weight: 600; padding: .7rem 1rem .8rem; cursor: pointer; color: var(--ink-2);
}
[role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
[role="tab"]:hover { color: var(--ink); }
.tabs .guide { padding-top: clamp(1.8rem, 3vw, 2.8rem); }
.js .guide[hidden] { display: none; }
.guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2rem clamp(2rem, 5vw, 5rem); }
.guide h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: 18ch; }
.guide h3::before { content: "▸"; color: var(--orange); margin-right: .45rem; }
.guide p { max-width: 62ch; }
.guide > p { grid-column: 2; }
.note { border-left: 3px solid var(--orange); padding-left: 1rem; color: var(--ink-2); }
.mark { font-family: var(--mono); font-size: .8em; text-transform: uppercase; color: var(--orange-ink); }

/* Sunny 16 */
.sunny {
  background: var(--paper-2); box-shadow: 0 0 0 100vmax var(--paper-2); clip-path: inset(0 -100vmax);
  border-bottom: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 5rem);
}
.sunny .section-head { grid-column: 1 / -1; }
.sunny > .result { margin-top: .75rem; }

fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; min-width: 0; }
legend { margin-bottom: .7rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label {
  display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--ink); padding: .45rem .8rem;
  font-family: var(--mono); font-size: .95rem; cursor: pointer; background: var(--paper);
  transition: background var(--ease), color var(--ease);
}
.chips input { accent-color: var(--orange); margin: 0; }
.chips label:has(input:checked) { background: var(--ink); color: var(--paper); }
.chips label:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }
.chips-light label { width: 100%; font-family: var(--sans); font-size: .95rem; }
.chips-light b { font-family: var(--mono); font-weight: 600; min-width: 3.2em; }
.help { font-size: .9rem; color: var(--ink-2); max-width: 48ch; }

.result {
  background: var(--sheet); color: var(--sheet-text); padding: 1.5rem clamp(1.2rem, 3vw, 2rem) 1.8rem;
  border-top: 8px solid var(--orange); align-self: start;
}
.result .dateline { color: var(--sheet-text); opacity: .85; }
.big {
  font-family: var(--mono); font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -.03em;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .4em; margin: 0 0 .6rem; color: var(--orange);
}
.at {
  font-family: var(--sans); font-size: .35em; letter-spacing: .1em; text-transform: uppercase; color: var(--sheet-text);
}
.result-note { font-size: .9rem; opacity: .85; margin-bottom: 1.4rem; }

.equiv { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .9rem; }
.equiv caption { text-align: left; padding-bottom: .5rem; }
.equiv th, .equiv td { text-align: left; padding: .45rem .5rem .45rem 0; border-top: 1px solid var(--sheet-2); }
.equiv th { font-weight: 600; font-size: .75rem; color: var(--sheet-text); }
.equiv td:last-child { font-family: var(--sans); opacity: .8; }
.equiv .is-base td { color: var(--orange); }
.equiv .is-base td:first-child::before { content: "● "; }

/* Reference */
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem clamp(2rem, 5vw, 5rem); }
.ref-grid dl { margin: 0; }
.ref-grid dt { color: var(--orange-ink); margin-top: 1.4rem; }
.ref-grid dt:first-child { margin-top: 0; }
.ref-grid dd { margin: .35rem 0 0; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); max-width: 52ch; }

/* Colophon */
.colophon { padding-block: 2.5rem 3.5rem; font-size: .92rem; color: var(--ink-2); }
.colophon p { max-width: 68ch; }
.privacy { border-left: 3px solid var(--orange); padding-left: 1rem; color: var(--ink); }
.foot-links a { color: var(--ink); }

/* Responsive */
@media (max-width: 900px) {
  .sheet { grid-template-columns: repeat(3, 1fr); }
  .guide { grid-template-columns: 1fr; }
  .guide > p { grid-column: auto; }
  .sunny { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.js .nav-toggle { display: inline-flex; }
  body.js .site-nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-top: .5rem; }
  body.js .masthead.is-open .site-nav { display: flex; }
  body.js .site-nav a { padding: .7rem 0; border-top: 1px solid var(--rule); border-bottom: 0; }
  body.js .site-nav a:hover { color: var(--orange-ink); }
}

@media (max-width: 560px) {
  .sheet {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 1rem;
    scrollbar-width: thin; scrollbar-color: var(--orange) var(--sheet-2);
  }
  .frame { flex: 0 0 62%; scroll-snap-align: start; }
  .tablist { gap: 0; }
  [role="tab"] { flex: 1 1 auto; padding-inline: .5rem; font-size: .95rem; }
  .big { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
