/* ── Open Edition: the start page ──────────────────────────────────
   Tokens, type and the text-block classes (.ident, .link) come from
   css/base.css, as on every portfolio. One size of type (14px), two
   strengths (ink and 50%), hairlines between the parts, and space.
   A label column on the left and the words on the right; on a phone
   the label sits above. The first screen (further down) uses the same
   two columns: the line, the field and the index of themes on the left,
   the live frame on the right.
   ───────────────────────────────────────────────────────────────── */

html, body { background: var(--paper); color: var(--ink); }
body { line-height: 1.3; }
code { font: inherit; }
ol { margin: 0; padding: 0; list-style: none; }

/* Hover states only where there's a real pointer: on touch screens :hover sticks after a tap. */
.oe-quiet-link, .oe-inline, .oe-go, .oe-send { transition: opacity var(--t-state) var(--ease); }
@media (hover: hover) {
  .oe-quiet-link:hover, .oe-inline:hover { opacity: .5; }
}

/* ── Head: the name top left, as on every portfolio ──────────────── */
.oe-head {
  display: grid;
  /* The name's column is the rows' label column, or wider where the name wouldn't fit it. */
  grid-template-columns: minmax(max-content, 25%) minmax(0, 1fr);
  align-items: start;
  padding: var(--pad-top) var(--pad-right) 0 var(--pad-left);
}
.oe-head .ident { line-height: 1; padding-right: 24px; }

/* The nav: a second text block, on the words' column, level with the name. Each part of the
   page at 50%, in ink under the pointer; no boxes. */
.oe-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; line-height: 1; }
.oe-nav a {
  padding-bottom: 2.4px;
  white-space: nowrap;
  text-decoration: none;
  opacity: .5;
  transition: opacity var(--t-state) var(--ease);
}
@media (hover: hover) { .oe-nav a:hover { opacity: 1; } }
/* Where a link lands: a little air above the part's hairline. */
.oe-row { scroll-margin-top: 24px; }
/* Headings take focus from the nav; the ring only for the keyboard. */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* ── Main ───────────────────────────────────────────────────────── */
.oe-main {
  /* The same clearance between the name and what follows as between the name and the work. */
  padding: var(--clearance) var(--pad-right) calc(var(--pad-bottom) + 12vh) var(--pad-left);
  --label-w: 25%;
}
/* A part of the page: label left (50%), words right, on a hairline. */
.oe-row {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  align-items: baseline;
  padding: 10px 0 max(64px, 9vh);
  border-top: 1px solid var(--line);
}
/* "put it online": one line that leads into the three ways under it. */
.oe-row--lead { padding-bottom: 40px; }
.oe-row--last { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.oe-label { opacity: .5; }
.oe-body { min-width: 0; }
.oe-text, .oe-note, .oe-field { max-width: 34em; text-wrap: pretty; }
/* How: three short steps, one after another; no numbers, just space between them. */
.oe-step { margin-top: 2.6em; }
/* A step's second paragraph: its own, but kept with the step. */
.oe-step-on { margin-top: .9em; }
.oe-step-label { display: block; }
.oe-inline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* Exactly what to type, set in the page's own type: the line in ink, what it does at 50%. */
.oe-lines {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0 32px;
  margin: 1.3em 0 0;
}
.oe-lines p { display: contents; }
.oe-lines span { opacity: .5; }
.oe-copy { display: inline-block; margin-top: 1.3em; padding-bottom: 0; opacity: .5; }
.oe-copy.is-done { opacity: 1; }
@media (hover: hover) { .oe-copy:hover { opacity: 1; } }
.oe-note { margin-top: 1.3em; opacity: .5; }

/* The embed: exactly what to paste, in the page's own type. The board's slug sits at 50%
   until a preview fills in the real one. Long lines wrap at spaces, never sideways. */
.oe-snippet {
  margin: 1.3em 0 0;
  max-width: 46em;
  font: inherit;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.oe-snippet code { font: inherit; }
.oe-slug { opacity: .5; transition: opacity var(--t-fade) var(--ease); }
.oe-slug.is-filled { opacity: 1; }

/* Your own copy: the ways to deploy, as plain text links on one line. */
.oe-actions { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 1.3em; }
.oe-soon { opacity: .5; }
.oe-note code { white-space: nowrap; }

/* ── Fields: a line of text on a hairline ────────────────────────── */
.oe-field { display: block; }
.oe-field + .oe-field { margin-top: 28px; }
.oe-field-label { display: block; opacity: .5; }
.oe-field-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  transition: border-color var(--t-state) var(--ease);
}
.oe-field-line:focus-within { border-bottom-color: var(--ink); }
.oe-field.is-wrong .oe-field-line { border-bottom-color: var(--ink); }
.oe-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  font: 14px/1.3 var(--font);
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.oe-input::placeholder { color: var(--ink); opacity: .25; }
.oe-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--paper) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}
/* The address reads as one line: what you type, then the domain at 50%. The input is
   only as wide as its text (field-sizing, or the size start.js keeps), so the domain follows it. */
.oe-address { gap: 0; }
.oe-address .oe-input { flex: 0 1 auto; field-sizing: content; min-width: 1ch; max-width: 100%; }
.oe-suffix { flex: 1; opacity: .5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "see yours" waits at 50% until there's a link to see. */
.oe-go { line-height: 1.3; padding: 0; white-space: nowrap; opacity: .5; }
.oe-go.is-ready { opacity: 1; }
@media (hover: hover) { .oe-go.is-ready:hover { opacity: .5; } }
.oe-hint { margin-top: 8px; opacity: .5; transition: opacity var(--t-state) var(--ease); }
.oe-hint:empty { display: none; }
.oe-field.is-wrong .oe-hint { opacity: 1; }

/* iOS zooms in on any field under 16px. On touch screens the fields step up to 16px. */
@media (hover: none) and (pointer: coarse) {
  .oe-input, .oe-suffix { font-size: 16px; }
}

/* ── Asking ──────────────────────────────────────────────────────── */
.oe-ask { margin-top: 28px; }
.oe-send-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-top: 32px; }
.oe-send { line-height: 1.3; padding: 0; opacity: .5; }
.oe-send.is-ready { opacity: 1; }
@media (hover: hover) { .oe-send.is-ready:hover { opacity: .5; } }
.oe-sent { margin-top: 0; }

.oe-noscript { padding: 0 var(--pad-right) 48px var(--pad-left); }

/* ── Smaller screens ─────────────────────────────────────────────── */
/* Below 900px the name is wider than the label column, so the nav can't start on the words'
   edge: it goes under the name, one line; if it ever runs out of room it scrolls sideways
   (the line only, never the page). */
@media (max-width: 899px) {
  .oe-head { grid-template-columns: minmax(0, 1fr); }
  .oe-nav {
    flex-wrap: nowrap;
    gap: 0 20px;
    /* Taller targets for a finger, without moving the line: the padding is taken back. */
    margin: 10px calc(-1 * var(--pad-right)) -8px calc(-1 * var(--pad-left));
    padding: 8px var(--pad-right) 8px var(--pad-left);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .oe-nav::-webkit-scrollbar { display: none; }
  .oe-head .ident { padding-right: 0; }
}
@media (max-width: 767px) {
  .oe-main { --label-w: 1fr; }
  .oe-row { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 64px; }
  .oe-row--lead { padding-bottom: 32px; }
  /* What each line does goes under it. */
  .oe-lines { grid-template-columns: minmax(0, 1fr); }
  .oe-lines span { margin-bottom: 10px; }
}


/* ── The first screen ───────────────────────────────────────────────
   Desktop: the label column holds the line, the field and the index of
   themes; the frame fills the word column, as tall as the screen allows,
   its left edge on the rows' words, whose board it is said under it.
   Phone: the line, the field, whose board, the frame (upright, most of
   a screen), the names as one line, scrolled sideways.

   Two frames, one over the other: the next look draws unseen behind the
   one showing and fades up over it only once its photographs are in, so
   nothing flashes white and the layout never moves. Before the first has
   drawn, the example site's own name stands where the site will put it.
   ───────────────────────────────────────────────────────────────── */
.oe-first {
  /* A theme dissolving into the next: slower than a note, so you can see the same
     photographs being rearranged. Their own board arriving takes longer still. */
  --t-swap: 480ms;
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  grid-template-areas:
    "line  stage"
    "try   stage"
    "index stage"
    ".     stage";
  /* The screen under the name, less a little at the foot so the page shows it goes on. */
  height: calc(100svh - var(--pad-top) - var(--ident-h) - var(--clearance) - 40px);
  min-height: 560px;
  max-height: 1100px;
  margin-bottom: max(96px, 14vh);
}
.oe-line, .oe-try, .oe-index { padding-right: 28px; min-width: 0; }
.oe-line  { grid-area: line; }
/* The field straight under the line: the first thing to do, not a footnote. */
.oe-try   { grid-area: try; margin-top: 32px; max-width: none; }
.oe-index { grid-area: index; margin-top: max(48px, 7vh); }
.oe-stage { grid-area: stage; min-height: 0; }

.oe-headline { line-height: 1.3; text-wrap: pretty; max-width: 26em; }
/* Each sentence on its own line where the column allows. */
.oe-headline span { display: inline-block; }
.oe-intro { line-height: 1.3; opacity: .5; max-width: 26em; text-wrap: pretty; }
.oe-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* The field: start.css's hairline field, with more room under the line. */
.oe-try .oe-field-line { margin-top: 0; padding-bottom: 10px; gap: 24px; }
.oe-try .oe-hint { line-height: 1.3; }

/* ── The index: a name and what it does, the one showing in ink ──── */
.oe-themes { margin: 0; padding: 0; list-style: none; }
.oe-themes button, .oe-schemes button {
  line-height: 1.3;
  text-align: left;
  opacity: .5;
  transition: opacity var(--t-state) var(--ease);
}
.oe-themes button {
  display: grid;
  grid-template-columns: 4.9em minmax(0, 1fr);
  gap: 0 12px;
  width: 100%;
  padding: 2px 0;
}
.oe-themes button[aria-pressed="true"], .oe-schemes button[aria-pressed="true"] { opacity: 1; }
@media (hover: hover) { .oe-themes button:hover, .oe-schemes button:hover { opacity: 1; } }
.oe-what { text-wrap: pretty; }
/* Once it's their board: what their text block sets, first, and black or white under. */
.oe-themes li:first-child:not([hidden]) { margin-bottom: 6px; }
.oe-schemes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 1.3em; }
.oe-now { display: none; }
.oe-themes li.is-in, .oe-schemes.is-in { animation: oe-rise var(--t-fade) var(--ease) both; }

/* ── The stage: the frame, and whose board it is under it ─────────── */
.oe-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "frame frame" "whose after";
  column-gap: 32px;
}
.oe-frame-wrap { grid-area: frame; }
.oe-whose { grid-area: whose; }
.oe-after { grid-area: after; }
.oe-whose, .oe-after { padding-top: 10px; line-height: 1.3; }
.oe-whose { display: flex; gap: 0 24px; white-space: nowrap; min-width: 0; }
.oe-whose-text { opacity: .5; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.oe-whose.is-yours .oe-whose-text { opacity: 1; }
.oe-after { opacity: .5; text-align: right; text-wrap: pretty; }
.oe-after .oe-back { display: none; }
.oe-back { line-height: 1.3; padding: 0; opacity: .5; transition: opacity var(--t-state) var(--ease); }
@media (hover: hover) { .oe-back:hover { opacity: 1; } }
/* Whose it is changes in place: out quickly, in a touch slower, from 4px below. */
.oe-whose .oe-whose-text.is-out, .oe-stage .oe-after.is-out { opacity: 0; transition: opacity var(--t-state) var(--ease); }
.oe-whose-text.is-in, .oe-after.is-in { animation: oe-rise var(--t-fade) var(--ease) both; }
.oe-after.is-in { animation-name: oe-rise-half; }
@keyframes oe-rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes oe-rise-half { from { opacity: 0; transform: translateY(4px); } to { opacity: .5; } }

/* The site, edge to edge in its box. A hairline marks where it ends and this page begins:
   without it, the site's own name top left reads as this page's. */
.oe-frame-wrap {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  contain: strict;
  container-type: size;
}
/* Held until the first look has drawn: the example's name where the site puts its own
   (16px down, 1% of its width in; 2.5% when the site is phone-sized), so the frame
   coming up over it reads as the site arriving, not a box being filled. */
.oe-poster {
  position: absolute;
  inset: 0;
  padding: 16px 1cqw;
  transition: opacity var(--t-fade) var(--ease);
}
@container (max-width: 767px) { .oe-poster { padding-inline: 2.5cqw; } }
.oe-poster.is-gone { opacity: 0; }

.oe-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}
.oe-frame.is-front { opacity: 1; z-index: 2; pointer-events: auto; }
/* The next look comes up over the one showing, which stays whole underneath until it's done. */
.oe-frame.is-coming { z-index: 3; opacity: 1; transition: opacity var(--t-swap) var(--ease); }
.oe-frame.is-coming.is-hold { opacity: 0; transition: none; }
/* Their own photographs taking the example's place: the moment the page is for. Slower,
   so you see it happen; nothing else moves. */
.oe-frame.is-coming.is-theirs { transition-duration: 900ms; }

/* Touch screens only (below): a clear sheet over the frame, so a swipe on it scrolls the
   page. A tap takes it away (is-live) and lets you into the site; a touch anywhere else
   on the page puts it back. */
.oe-cover { display: none; position: absolute; inset: 0; z-index: 4; }

@media (hover: none) and (pointer: coarse) {
  .oe-cover { display: block; }
  .oe-frame-wrap.is-live .oe-cover { display: none; }
  .oe-themes button { padding: 8px 0; }
  .oe-schemes { gap: 0 20px; }
  .oe-schemes button, .oe-back { padding: 10px 0; margin: -10px 0; }
  /* "see yours": a bigger target without a taller line. */
  .oe-go { padding: 12px 0 12px 12px; margin: -12px 0; }
}

/* ── Narrower desktops: the label column can't hold the words beside the names ── */
@media (min-width: 900px) and (max-width: 1099px) {
  .oe-first { --label-w: 36%; }
  .oe-themes button { grid-template-columns: minmax(0, 1fr); }
  .oe-what { display: none; }
  .oe-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "frame" "whose" "after"; }
  .oe-after { text-align: left; padding-top: 4px; }
}

/* ── Phone (and an upright tablet): the line, the field, the frame, the names as one line ── */
@media (max-width: 899px) {
  .oe-first {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 72px;
  }
  .oe-line, .oe-try, .oe-index { padding-right: 0; }
  /* The stage's parts take their own places in the column. */
  .oe-stage { display: contents; }
  .oe-line  { order: 1; }
  .oe-try   { order: 2; margin-top: 28px; }
  .oe-whose { order: 3; margin-top: 36px; padding: 0 0 10px; }
  .oe-frame-wrap { order: 4; flex: none; width: 100%; height: clamp(420px, 72svh, 760px); }
  .oe-index { order: 5; margin-top: 6px; }
  .oe-after { order: 6; margin-top: 12px; padding-top: 0; text-align: left; }
  /* "back to the example" lives under the frame, on its own line. */
  .oe-whose .oe-back { display: none; }
  .oe-after .oe-back { display: block; margin-top: 12px; opacity: 1; }
  .oe-after.is-in { animation-name: oe-rise-half; }

  /* One line of names, run out to the screen's edges and scrolled sideways (the line only,
     never the page); the one showing is kept in view. What it does sits under it. */
  .oe-themes {
    display: flex;
    gap: 0 20px;
    margin: 0 calc(-1 * var(--pad-right)) 0 calc(-1 * var(--pad-left));
    padding: 0 var(--pad-right) 0 var(--pad-left);
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--pad-left) var(--pad-right);
  }
  /* The line runs on past the screen's edge: the next name always shows in part,
     softened as it goes, so it reads as more to come. */
  .oe-themes {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .oe-themes.is-end { -webkit-mask-image: none; mask-image: none; }
  .oe-themes::-webkit-scrollbar { display: none; }
  .oe-themes li { flex: none; }
  .oe-themes li:first-child:not([hidden]) { margin-bottom: 0; }
  .oe-themes button { display: block; width: auto; white-space: nowrap; padding: 10px 0; }
  .oe-what { display: none; }
  .oe-now { display: block; line-height: 1.3; opacity: .5; min-height: 1.3em; }
  .oe-schemes { margin-top: 14px; }
}
@media (max-width: 389px) { .oe-themes { gap: 0 16px; } }

/* ── Reduced motion: it never moves on by itself; changes are a short fade ── */
@media (prefers-reduced-motion: reduce) {
  .oe-first { --t-swap: 150ms; }
  .oe-frame.is-coming.is-theirs { transition-duration: 150ms; }
  .oe-whose-text.is-in, .oe-after.is-in, .oe-themes li.is-in, .oe-schemes.is-in { animation: none; }
}
