/* trond.studio — build-in-public studio site.
   Dark-first, warm-paper light mode. Every colour pair below was checked
   against WCAG AA (4.5:1 body text, 3:1 large text and UI edges).
   Brass and ember are bright enough to work on ink but NOT on paper, so each
   has a darkened twin (--brass-t / --ember-t) used for text in light mode. */

:root {
  color-scheme: dark light;

  --bg:        #0a0c11;
  --bg-2:      #0d1017;
  --surface:   #141922;
  --ink:       #eef2f7;
  --ink-mute:  #98a3b3;
  --rule:      #262e3b;

  --brass:   #e9a93c;
  --brass-t: #e9a93c;
  --ember:   #ff5230;
  --ember-t: #ff6a4d;

  --radius: 14px;
  --wrap: 1080px;
  --step: clamp(46px, 6.5vw, 84px);

  --font: ui-sans-serif, -apple-system, "SF Pro Text", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:       #fbf7f1;
    --bg-2:     #f5efe5;
    --surface:  #ffffff;
    --ink:      #14181f;
    --ink-mute: #5a6472;
    --rule:     #e4ddd1;
    --brass-t:  #8a5300;   /* 5.9:1 on paper; bright brass would be 2.0:1 */
    --ember-t:  #b8330f;   /* 5.4:1 on paper */
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 10000;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}
.wordmark {
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  font-size: 17px;
}
.dot { color: var(--brass-t); }
.site-head nav { display: flex; gap: 22px; font-size: 14.5px; }
.site-head nav a {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .18s;
}
.site-head nav a:hover { color: var(--ink); }

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

.hero {
  position: relative;
  padding: clamp(64px, 12vw, 132px) 0 clamp(36px, 5vw, 56px);
  overflow: hidden;
}
.hero::after {
  
  content: "";
  position: absolute;
  top: -34%;
  left: 42%;
  width: 72vw;
  height: 72vw;
  background: radial-gradient(circle,
              color-mix(in srgb, var(--brass) 26%, transparent) 0%,
              transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

.eyebrow {
  font-size: 15px;
  color: var(--ink-mute);
  margin: 0 0 18px;
}

h1 {
  font-size: clamp(46px, 10vw, 112px);
  line-height: .92;
  letter-spacing: -.032em;
  font-weight: 800;
  margin: 0 0 26px;
  max-width: 15ch;
}
h1 em {
  font-style: normal;
  color: var(--brass-t);
  position: relative;
  white-space: nowrap;
}
h1 em::after {
  
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .04em;
  height: .07em;
  background: var(--ember-t);
  opacity: .85;
  border-radius: 2px;
}

.lede {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 58ch;
  margin: 0;
}
.lede strong { color: var(--ink); font-weight: 600; }

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
  overflow: hidden;
  padding: 13px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: slide 46s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-mute);
  padding: 0 20px;
  white-space: nowrap;
}
.ticker span::after {
  content: "◆";
  margin-left: 20px;
  color: var(--brass-t);
  opacity: .55;
}
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

section { padding: var(--step) 0; }

.label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink-mute);
  margin: 0 0 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 750;
  margin: 0 0 18px;
}

/* ---------- project cards ---------- */

.projects { display: grid; gap: 26px; }

.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
  align-items: center;
  gap: 34px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 34px 0 34px 34px;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.project:nth-child(even) { direction: rtl; padding: 34px 34px 34px 0; }
.project:nth-child(even) > * { direction: ltr; }

.shots {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  min-height: 300px;
}
.shot {
  width: 46%;
  max-width: 190px;
  height: auto;
  display: block;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, .75);
  background: var(--bg);
}
.shot-a { transform: rotate(-4deg) translateY(10px); z-index: 2; }
.shot-b { transform: rotate(4deg) translateX(-16px); z-index: 1; }
.project:hover .shot-a { transform: rotate(-6deg) translateY(4px); }
.project:hover .shot-b { transform: rotate(6deg) translateX(-20px) translateY(-4px); }
.shot { transition: transform .35s cubic-bezier(.2, .7, .3, 1); }
.project:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brass) 55%, var(--rule));
}

/* Three letter-proportioned pages, fanned like a stack on a desk. Same
   idea as the phone screenshots, different object. */
.pages {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
.page-sheet {
  position: absolute;
  width: 58%;
  max-width: 178px;
  height: auto;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .72);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.page-1 { transform: rotate(-7deg) translateX(-28%); z-index: 1; }
.page-2 { transform: rotate(-1deg) translateY(6px);  z-index: 3; }
.page-3 { transform: rotate(6deg)  translateX(28%);  z-index: 2; }
.project:hover .page-1 { transform: rotate(-10deg) translateX(-36%); }
.project:hover .page-3 { transform: rotate(9deg)   translateX(36%); }
@media (max-width: 860px) { .pages { min-height: 250px; } .page-sheet { max-width: 148px; } }
@media (prefers-reduced-motion: reduce) {
  .project:hover .page-1, .project:hover .page-3 { transform: none; }
}

/* Inline so it inherits the theme: the diagram uses the page's own tokens
   and therefore reads correctly on ink and on paper without a second asset. */
.diagram-wrap { display: flex; justify-content: center; align-items: center; }
.diagram { width: 100%; max-width: 320px; height: auto; }
.diagram .d-mute   { color: var(--rule); }
.diagram .d-rule   { color: var(--rule); }
.diagram .d-mute-t { fill: var(--ink-mute); }
.diagram .d-ink    { fill: var(--ink); }
.diagram .d-node   { fill: var(--ink-mute); }
.diagram .d-accent { color: var(--brass-t); stroke: var(--brass-t); fill: var(--brass-t); }
.diagram .d-accent[fill="none"] { fill: none; }
.diagram .d-accent-t { fill: var(--brass-t); }
@media (max-width: 860px) { .diagram { max-width: 280px; } }

.plate-wrap { display: flex; justify-content: center; align-items: center; }
.plate {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .7);
  background: var(--bg);
}
.plate-paper { border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.plate-icon { border-radius: 22%; max-width: 190px; }
@media (max-width: 860px) { .plate { max-width: 210px; } }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.project h3 {
  font-size: 27px;
  letter-spacing: -.03em;
  font-weight: 750;
  margin: 6px 0 4px;
}
.project .tagline { font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.project p { color: var(--ink-mute); margin: 0 0 18px; font-size: 16px; }

.chip {
  font-size: 14px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.stories { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--rule); }
.stories-h {
  font-size: 14px;
  color: var(--ink-mute);
  margin: 0 0 6px;
}
.story {
  display: block;
  padding: 4px 0;
  text-decoration: none;
  font-size: 15px;
}

.story .t {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brass) 55%, transparent);
  text-underline-offset: 3px;
  transition: color .18s;
}
.story .t { }
.story-d {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  margin-left: 8px;
  white-space: nowrap;
}
.story {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: text-decoration-color .18s, color .18s;
}
.story:hover { text-decoration-color: var(--brass); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.links a {
  font-size: 14.5px;
  color: var(--ink-mute);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  padding: 6px 0;
  transition: color .18s, text-decoration-color .18s;
}
.links a:hover { color: var(--ink); text-decoration-color: var(--brass); }

/* ---------- app page ---------- */

.app-hero { padding-bottom: clamp(30px, 4vw, 48px); }
.app-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  align-items: center;
  gap: 40px;
}
.hero-shots { min-height: 340px; }
.hero-shots .shot { max-width: 205px; }

.features {
  display: grid;
  gap: 0 56px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.feature {
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.feature h3 {
  font-size: 18px;
  letter-spacing: -.02em;
  font-weight: 700;
  margin: 0 0 6px;
}
.feature p { color: var(--ink-mute); margin: 0; font-size: 15.5px; max-width: 46ch; }

/* Horizontal filmstrip of screenshots: scrolls on narrow screens rather than
   shrinking to thumbnails. */
.gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.gallery img {
  flex: 0 0 auto;
  width: 216px;
  height: auto;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .7);
  scroll-snap-align: start;
  background: var(--bg);
}

@media (max-width: 860px) {
  .app-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-shots { min-height: 0; }
  .hero-shots .shot { max-width: 172px; }
  .gallery img { width: 178px; }
}

/* ---------- open source cards ----------
   Deliberately lighter than a project card: these are things you clone, not
   things with a product surface to photograph. Metadata is language and
   licence, which are stable; star counts are not, so they are not shown. */

.repos {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.repo {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-decoration: none;
  transition: border-color .22s ease, transform .22s ease;
}
.repo:hover {
  border-color: color-mix(in srgb, var(--brass) 45%, var(--rule));
  transform: translateY(-3px);
}
.repo h3 {
  font-size: 19px;
  letter-spacing: -.02em;
  font-weight: 700;
  margin: 0 0 4px;
}
.repo:hover h3 { color: var(--brass-t); }
.repo .slug {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  margin: 0 0 12px;
  word-break: break-all;
}
.repo p { color: var(--ink-mute); margin: 0 0 16px; font-size: 15.5px; flex: 1; }
.repo-meta { font-size: 14px; color: var(--ink-mute); }

/* ---------- pull quote ---------- */

.pull {
  position: relative;
  padding: 4px 0;
  text-indent: -.42em;
  margin: 0 0 22px;
  font-size: clamp(23px, 3.4vw, 34px);
  line-height: 1.28;
  letter-spacing: -.025em;
  font-weight: 650;
  max-width: 26ch;
}
.pull cite {
  display: block;
  margin-top: 16px;
  font-size: 13.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-mute);
  font-family: var(--mono);
}

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

.posts { border-top: 1px solid var(--rule); }
.post {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 4px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background .2s ease;
}
.post:hover { background: color-mix(in srgb, var(--brass) 7%, transparent); }
.post .t { font-weight: 600; transition: color .18s; }
.post:hover .t { color: var(--brass-t); }
.post .d {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-mute);
  flex: none;
}

.cta {
  display: inline-block;
  margin-top: 30px;
  background: var(--brass);
  color: #17130a;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  transition: transform .18s ease, filter .18s ease;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.07); }

/* The quiet line under a .cta: practical caveats (how it installs, what it
   costs) that belong with the button, not in the body copy. */
.cta-note { color: var(--ink-mute); font-size: 13px; margin: 10px 0 0; }
.cta-note a { color: var(--brass-t); }

.note { color: var(--ink-mute); max-width: 64ch; margin: 0; }
.note a { color: var(--brass-t); }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 30px 0 44px;
  background: var(--bg-2);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-mute);
}
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.site-foot a { display: inline-block; padding: 6px 0; }
.site-foot a { color: var(--ink-mute); text-decoration: none; }
.site-foot a:hover { color: var(--brass-t); }

/* ---------- legal / prose pages ---------- */

.prose { max-width: 720px; padding-top: 52px; padding-bottom: 84px; }
.prose h1 {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.05;
  margin-bottom: 10px;
  max-width: none;
}
.prose h2 { font-size: 21px; margin: 44px 0 12px; letter-spacing: -.02em; }
.prose p, .prose li { color: var(--ink); }
.prose a { color: var(--brass-t); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }

.backlink {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-mute);
  text-decoration: none;
  margin-bottom: 26px;
}
.backlink:hover { color: var(--brass-t); }

.updated {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 30px;
}

.summary-box {
  margin: 0 0 38px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.summary-box p {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- motion ---------- */

/* Progressive enhancement: content is visible by default. The script adds
   .js-reveal to <html> before anything is hidden, and a timer un-hides
   everything if the observer never fires. No JS means no animation, never a
   blank page. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.js-reveal .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
  .ticker-track { animation: none; }
  .project:hover { transform: none; }
  .cta:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .project:hover .shot-a,
  .project:hover .shot-b { transform: none; }
}

@media (max-width: 860px) {
  /* Stack: copy first, screenshots below, both projects the same way round. */
  .project,
  .project:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    padding: 30px 26px;
    gap: 26px;
  }
  .shots { min-height: 0; }
  .shot { max-width: 168px; }
}

@media (max-width: 640px) {
  .site-head .wrap { height: auto; min-height: 62px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
  .site-head nav { gap: 14px; font-size: 14px; flex-wrap: wrap; }
  .site-head .nav-cta { display: none; }
  .post { flex-direction: column; gap: 3px; }
  .pull { font-size: 22px; padding-left: 18px; }
  /* Three letter-proportioned pages, fanned like a stack on a desk. Same
   idea as the phone screenshots, different object. */
.pages {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
.page-sheet {
  position: absolute;
  width: 58%;
  max-width: 178px;
  height: auto;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .72);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.page-1 { transform: rotate(-7deg) translateX(-28%); z-index: 1; }
.page-2 { transform: rotate(-1deg) translateY(6px);  z-index: 3; }
.page-3 { transform: rotate(6deg)  translateX(28%);  z-index: 2; }
.project:hover .page-1 { transform: rotate(-10deg) translateX(-36%); }
.project:hover .page-3 { transform: rotate(9deg)   translateX(36%); }
@media (max-width: 860px) { .pages { min-height: 250px; } .page-sheet { max-width: 148px; } }
@media (prefers-reduced-motion: reduce) {
  .project:hover .page-1, .project:hover .page-3 { transform: none; }
}

/* Inline so it inherits the theme: the diagram uses the page's own tokens
   and therefore reads correctly on ink and on paper without a second asset. */
.diagram-wrap { display: flex; justify-content: center; align-items: center; }
.diagram { width: 100%; max-width: 320px; height: auto; }
.diagram .d-mute   { color: var(--rule); }
.diagram .d-rule   { color: var(--rule); }
.diagram .d-mute-t { fill: var(--ink-mute); }
.diagram .d-ink    { fill: var(--ink); }
.diagram .d-node   { fill: var(--ink-mute); }
.diagram .d-accent { color: var(--brass-t); stroke: var(--brass-t); fill: var(--brass-t); }
.diagram .d-accent[fill="none"] { fill: none; }
.diagram .d-accent-t { fill: var(--brass-t); }
@media (max-width: 860px) { .diagram { max-width: 280px; } }

.plate-wrap { display: flex; justify-content: center; align-items: center; }
.plate {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .7);
  background: var(--bg);
}
.plate-paper { border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.plate-icon { border-radius: 22%; max-width: 190px; }
@media (max-width: 860px) { .plate { max-width: 210px; } }

.card-top { flex-direction: column; gap: 10px; }
}

.site-head nav a.nav-cta {
  background: var(--brass);
  color: #17130a;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  transition: filter .18s ease;
}
.site-head nav a.nav-cta:hover { color: #17130a; filter: brightness(1.08); }
