/* =========================================================================
   Afteroffice Studio v2 — an exhibition of annotated figures.

   The frame is deliberately quiet and achromatic, because the work it holds
   is not: eight screenshots in blue, green, orange and Telegram-green sit on
   this page, and any coloured frame would fight all of them at once.

   One accent exists — annotation vermilion — and it appears only on callouts
   and actions. Its scarcity is what makes a callout read as a pointer rather
   than decoration.
   ========================================================================= */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ground: oklch(95.8% 0.002 250);
  --mount: oklch(100% 0 0);
  --ink: oklch(20% 0.008 250);
  --ink-soft: oklch(45% 0.008 250);
  /* Must clear AA on BOTH surfaces this text lands on: 4.87:1 on the grey
     page ground and 5.50:1 on a white card. Tuning it for white alone left
     it failing on the ground, which is the harder of the two. */
  --ink-faint: oklch(52% 0.01 250);
  --mark: oklch(56% 0.2 32);
  --mark-wash: oklch(95% 0.03 32);
  /* A darker vermilion for text ON the wash; the base --mark only reaches
     4.37:1 against it. */
  --mark-ink: oklch(46% 0.19 32);
  --rule: oklch(88% 0.004 250);

  --measure: 62ch;
  --pad: 1.25rem;
  --page: 78rem;

  --shadow: 0 1px 2px oklch(20% 0.01 250 / 0.05),
    0 8px 24px oklch(20% 0.01 250 / 0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 60rem) {
  :root {
    --pad: 3rem;
  }
}

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

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

body {
  margin: 0;
  font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  /* No tabular-nums here. In this face `tnum` widens the comma and full stop
     to figure width, which puts a visible gap before every one of them in
     running prose. There is no column of numbers on this page that needs the
     alignment, so it is simply not used. */
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

::selection {
  background: var(--mark-wash);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: var(--measure);
  text-wrap: pretty;
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* --- masthead ---------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.top-in {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
}

.mark {
  font-weight: 600;
  letter-spacing: -0.035em;
  text-decoration: none;
  font-size: 1rem;
  white-space: nowrap;
}

/* On a phone the masthead must stay one line: "Studio" and the wordier nav
   labels drop out rather than wrapping the header to two rows. */
.mark small {
  font: inherit;
  display: none;
}

.top nav a:not(.lang) {
  display: none;
}

@media (min-width: 46rem) {
  .mark small {
    display: inline;
  }
  .top nav a:not(.lang) {
    display: inline;
  }
}

.mark span {
  color: var(--mark);
}

.top nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.top nav a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.top nav a:hover {
  color: var(--ink);
}

.lang {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink-soft);
}

.lang:hover {
  border-color: var(--mark);
  color: var(--mark);
}

/* --- opening ----------------------------------------------------------- */

.open {
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2rem, 5vw, 3.5rem);
}

.open h1 {
  font-size: clamp(1.9rem, 5.2vw, 3.4rem);
  max-width: 20ch;
}

.open p {
  margin-top: 1.35rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

/* --- section ----------------------------------------------------------- */

.sec {
  padding-block: clamp(2.75rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
}

.sec-head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sec h2 {
  font-size: clamp(1.45rem, 3.6vw, 2.3rem);
  max-width: 22ch;
}

.sec-body {
  color: var(--ink-soft);
}

@media (min-width: 60rem) {
  .sec-head {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: end;
    gap: 2.5rem;
  }
  .sec-head .kicker {
    grid-column: 1 / -1;
    margin-bottom: -0.4rem;
  }
}

/* --- figure ------------------------------------------------------------ */

.fig {
  /* <figure> carries a 40px inline margin by UA default, which quietly ate
     80px of a 390px screen. */
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.fig--small {
  max-width: 46rem;
}

/* The mount: a white board the screenshot is hung on. */
.mount {
  position: relative;
  background: var(--mount);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  /* Screenshots are wide and dense; on a phone the figure scrolls inside its
     own mount rather than shrinking into illegibility. */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Wide, dense screenshots are held at a legible minimum and scrolled inside
   the mount. Narrow crops are already readable at phone width, so forcing a
   minimum on those would only cut their right edge off. */
.mount-in {
  position: relative;
  width: 100%;
  min-width: 34rem;
}

.fig--small .mount-in {
  min-width: 0;
}

.mount img {
  width: 100%;
}

/* --- callouts ---------------------------------------------------------- */

.dot {
  position: absolute;
  width: 1.45rem;
  height: 1.45rem;
  margin: -0.725rem 0 0 -0.725rem;
  border-radius: 50%;
  background: var(--mark);
  color: var(--mount);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.45rem;
  text-align: center;
  box-shadow: 0 0 0 2.5px var(--mount), 0 2px 6px oklch(20% 0.01 250 / 0.25);
  cursor: default;
  transition: transform 0.14s var(--ease);
}

.legend {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  max-width: 52rem;
}

.legend-item {
  display: grid;
  grid-template-columns: 1.45rem 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.3rem 0.45rem;
  margin-left: -0.45rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s var(--ease);
}

.legend-num {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--mark);
  color: var(--mount);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.45rem;
  text-align: center;
}

.legend-item:hover,
.legend-item:focus-visible,
.legend-item[data-on="true"] {
  background: var(--mark-wash);
  color: var(--ink);
}

.pcard-body p {
  color: var(--ink-soft);
}

.fig[data-active] .dot[data-on="true"] {
  transform: scale(1.35);
}

.cap {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.cap b {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--mark);
}

/* --- plaque ------------------------------------------------------------ */

.plaque {
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0;
  max-width: 46rem;
}

.plaque div {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 0.5rem 1.25rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}

.plaque dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
  padding-top: 0.15rem;
}

.plaque dd {
  margin: 0;
  color: var(--ink);
}

/* --- actions ----------------------------------------------------------- */

.act {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--mark);
  background: var(--mark);
  color: var(--mount);
  transition: background 0.14s var(--ease);
}

.btn:hover {
  background: oklch(48% 0.2 32);
}

.btn--q {
  background: transparent;
  color: var(--mark);
}

.btn--q:hover {
  background: var(--mark-wash);
}

/* --- closing ----------------------------------------------------------- */

.rest {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--rule);
}

.rest h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.rest p {
  margin-top: 0.9rem;
  color: var(--ink-soft);
}

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

@media (min-width: 48rem) {
  .two {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

.two h3 {
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

.two p {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.foot {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}

.foot h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  max-width: 18ch;
}

.foot p {
  margin-top: 1rem;
  color: var(--ink-soft);
}

.foot-rule {
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.pending {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mark);
  border: 1.5px dashed currentColor;
  padding: 0.35rem 0.6rem;
}

/* --- utility ----------------------------------------------------------- */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  background: var(--mark);
  color: var(--mount);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .fig {
    animation: rise 0.5s var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* --- contents index ----------------------------------------------------- */
/* Seven sections of figures make a very long page. The index is what makes
   that length navigable on a phone rather than punishing. */

.index {
  display: grid;
  gap: 0;
  margin-top: 2.25rem;
  border-top: 1px solid var(--rule);
  max-width: 34rem;
}

.index a {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.index a:hover {
  color: var(--ink);
}

.index b {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--mark);
}

/* Anchored sections must clear the sticky masthead. */
.sec {
  scroll-margin-top: 3.75rem;
}

/* --- supporting pages --------------------------------------------------- */

.prose {
  margin-bottom: 1.15rem;
  color: var(--ink-soft);
}

.bullets {
  display: grid;
  gap: 0.7rem;
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.bullets li::marker {
  color: var(--mark);
}

.qa-q {
  font-size: 1.05rem;
  margin-top: 1.9rem;
  margin-bottom: 0.45rem;
}

.qa-a {
  color: var(--ink-soft);
}

.note {
  margin-top: 1.4rem;
  padding-left: 1rem;
  border-left: 2px solid var(--mark);
  color: var(--ink-soft);
  font-size: 0.93rem;
  max-width: var(--measure);
}

.status {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.status[data-tone="error"] {
  color: var(--mark);
}

/* --- forms & tool inputs ------------------------------------------------ */

.form,
.tool-form {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin-top: 1.5rem;
}

.tool-form {
  max-width: 44rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input,
.field textarea,
.tool-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--mount);
  border: 1px solid var(--rule);
  min-height: 2.8rem;
}

.field textarea,
.tool-input {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus-visible,
.field textarea:focus-visible,
.tool-input:focus-visible {
  border-color: var(--mark);
}

.field-error {
  font-size: 0.78rem;
  color: var(--mark);
  min-height: 1rem;
}

.hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* The Lab's output sheet, in v2's quieter register. */
.carbon {
  --sheet-bg: var(--mount);
  margin-top: 1.4rem;
  background: var(--mount);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.1rem;
  max-width: 48rem;
}

.carbon--alt {
  --sheet-bg: var(--mount);
}

.carbon-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.carbon-body {
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--ink);
}

.carbon-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.2rem 0 0.35rem;
}

.carbon-body h4:first-child {
  margin-top: 0;
}

.carbon-body ul {
  margin: 0.3rem 0;
  padding-left: 1.2rem;
}

.field-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.btn-mini {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
}

.btn-mini:hover {
  border-color: var(--mark);
  color: var(--mark);
}

/* --- catalogue ---------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-block: 0.6rem;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  min-height: 2.2rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-pressed="true"] {
  border-color: var(--mark);
  color: var(--mark-ink);
  background: var(--mark-wash);
}

.catalogue {
  border-top: 1px solid var(--rule);
  margin-top: 0.75rem;
}

.cat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

@media (min-width: 48rem) {
  .cat-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    align-items: center;
  }
}

.cat-name a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  font-weight: 550;
}

.cat-name a:hover {
  text-decoration-color: var(--mark);
}

.cat-stack {
  font-size: 0.8rem;
  color: var(--ink-faint);
  grid-column: 1 / -1;
}

@media (min-width: 48rem) {
  .cat-stack {
    grid-column: auto;
  }
}

.cat-status {
  grid-row: 1;
  grid-column: 2;
  justify-self: end;
  font-size: 0.72rem;
  white-space: nowrap;
}

@media (min-width: 48rem) {
  .cat-status {
    grid-column: 3;
  }
}

.dot-up {
  color: oklch(48% 0.14 155);
}

.dot-down {
  color: var(--mark);
}

.dot-bot {
  color: var(--ink-faint);
}

.top nav a[aria-current="page"] {
  color: var(--ink);
}

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

.pgrid {
  display: grid;
  /* Two columns on a phone. One card per screen would make 86 of them an
     endless scroll; the shelf has to feel browsable. */
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

@media (min-width: 40rem) {
  .pgrid {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  }
}

@media (min-width: 48rem) {
  .pgrid {
    gap: 1.75rem;
  }
}

.pcard {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--mount);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.pcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px oklch(20% 0.01 250 / 0.07), 0 14px 32px oklch(20% 0.01 250 / 0.12);
}

.pcard-cover {
  aspect-ratio: 1280 / 800;
  background: var(--ground);
  overflow: hidden;
}

.pcard-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.pcard-body {
  padding: 0.7rem 0.75rem 0.4rem;
  flex: 1;
}

.pcard-body h3 {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.pcard-body p {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.pcard-foot {
  padding: 0 0.75rem 0.7rem;
}

.chip {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.45rem;
  border: 1px solid currentColor;
}

.chip--up {
  color: oklch(48% 0.14 155);
}

.chip--down {
  color: var(--mark);
}

.chip--bot {
  color: var(--ink-faint);
}

.backlink {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.backlink:hover {
  color: var(--mark);
}

/* --- gallery & lightbox -------------------------------------------------- */

.shots {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

@media (min-width: 60rem) {
  .shots {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shot {
  display: block;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--mount);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  overflow: hidden;
  width: 100%;
}

.shot img {
  width: 100%;
  height: auto;
}

.shot:hover {
  border-color: var(--mark);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: oklch(20% 0.01 250 / 0.88);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  box-shadow: 0 12px 48px oklch(0% 0 0 / 0.5);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  border: 0;
  background: var(--mount);
  color: var(--ink);
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--mark);
  color: var(--mount);
}

.link {
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  word-break: break-all;
}
