/* Case studies: an app in Youell OS. Same wallpaper, menu bar and window chrome as the homepage;
   the article is a document window. Shares the homepage tokens (Inter, Fraunces, orange accent, light/dark). */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --win: #faf9f7;
  --card: #f1eee9;
  --menubar: rgba(255, 255, 255, .28);
  --line: rgba(0, 0, 0, .1);
  --text: #1d1d1f;
  --text-soft: #56565c;
  --accent: #d9702f;
  --accent-ink: #a9501a;
  --tc-bg: #fff1c2;
  --tc-ink: #6b4a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --win: #222028;
    --card: #2c2934;
    --menubar: rgba(20, 16, 36, .35);
    --line: rgba(255, 255, 255, .1);
    --text: #f2f1f5;
    --text-soft: #a9a7b3;
    --accent-ink: #f0a56d;
    --tc-bg: #4a3b10;
    --tc-ink: #ffe29a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #1b1533; color: var(--text); min-height: 100vh;
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ---- Youell OS chrome ---- */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: #1b1533 url(/case-studies/wallpaper.svg) center / cover no-repeat; }

.menubar {
  position: sticky; top: 0; z-index: 100; height: 28px; padding: 0 12px;
  display: flex; align-items: center; gap: 6px;
  background: var(--menubar); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  color: #fff; font-size: 13px; font-weight: 500; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.menubar a { color: inherit; text-decoration: none; padding: 4px 7px; border-radius: 5px; }
.menubar a:hover { background: rgba(255,255,255,.2); }
.menubar .logo { display: block; width: 16px; height: 16px; }
.menubar .app { font-weight: 700; padding: 0 7px 0 4px; }
.menubar .spacer { flex: 1; }
.menubar .status { display: inline-flex; align-items: center; gap: 6px; }
.menubar .status i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61,220,132,.25); }

/* The document window */
.doc {
  max-width: 800px; margin: 32px auto 0; background: var(--win); color: var(--text);
  border-radius: 12px; overflow: clip;
  box-shadow: 0 30px 70px -20px rgba(10,5,30,.55), 0 0 0 .5px rgba(0,0,0,.25);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .doc { animation: none; } }
.titlebar {
  position: sticky; top: 28px; z-index: 50; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--win) 86%, transparent);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
}
.titlebar .wtitle { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.lights { position: absolute; left: 13px; top: 12px; display: flex; gap: 8px; }
.lights .l { display: block; width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }
.l.close { background: #ff5f57; } .l.min { background: #febc2e; } .l.zoom { background: #28c840; }
.lights:hover .l::after { display: block; font: 700 9px/13px var(--sans); text-align: center; color: rgba(0,0,0,.55); }
.lights:hover .close::after { content: "×"; } .lights:hover .min::after { content: "–"; } .lights:hover .zoom::after { content: "+"; }
.navback { display: none; }
.doc main { padding-top: 4px; padding-bottom: 48px; }

.draft {
  background: var(--tc-bg); color: var(--tc-ink); font-size: 13px; line-height: 1.45;
  padding: 9px 16px; text-align: center;
}
mark.tc {
  background: var(--tc-bg); color: var(--tc-ink); border-radius: 4px; padding: 1px 6px;
  font: 700 11px/1.6 var(--mono); letter-spacing: .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.tcnote { font-size: .9em; color: var(--text-soft); }

.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 40px 0 14px; }
h1 { font: 500 clamp(32px, 6.2vw, 48px)/1.1 var(--serif); letter-spacing: -.01em; margin: 0 0 18px; }
h1 em, h2 em { font-style: italic; }
h2 { font: 500 26px/1.2 var(--serif); margin: 48px 0 12px; }
.lede { font-size: 20px; line-height: 1.55; color: var(--text-soft); margin: 0 0 28px; }
p { margin: 0 0 16px; }
ul { padding-left: 1.2em; margin: 0 0 16px; }
li { margin-bottom: 8px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 8px 0 8px; }
.facts div { background: var(--card); padding: 14px 16px; }
.facts dt { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 6px; }
.facts dd { margin: 0; font-weight: 500; line-height: 1.4; }

.hero-shot { margin: 32px auto 0; }
figure { margin: 24px 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(10, 5, 30, .5); }
figcaption { font-size: 14px; color: var(--text-soft); margin-top: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; margin: 24px auto; }
.pair figure { margin: 0; }
.pair img { border-radius: 22px; }

.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 12px; }
.num { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px; text-align: center; }
.num b { display: block; font: 500 clamp(34px, 9vw, 52px)/1 var(--serif); color: var(--accent-ink); margin-bottom: 8px; }
.num span { display: block; font-size: 14px; line-height: 1.4; color: var(--text-soft); }

.quote { border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; margin: 24px 0; font: italic 500 20px/1.45 var(--serif); }

.cta { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin: 56px 0 0; }
.cta h2 { margin-top: 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; padding: 11px 18px; border-radius: 10px; }
.btn:hover { filter: brightness(1.07); }

.cards { display: grid; gap: 16px; margin: 24px 0 8px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--accent); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card div { padding: 18px 20px 20px; }
.card h2 { font-size: 22px; margin: 0 0 6px; }
.card p { margin: 0; color: var(--text-soft); font-size: 16px; }

footer.legal { padding: 22px 0 36px; font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,.6); text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
footer.legal p { margin: 0 0 2px; }

/* Phones: the app fills the screen, like the homepage's windows; iOS-style back instead of traffic lights */
@media (max-width: 720px) {
  .menubar { display: none; }
  .doc { margin: 0; border-radius: 0; box-shadow: none; animation: none; min-height: 100vh; }
  .titlebar { top: 0; height: calc(50px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .titlebar .wtitle { display: none; }   /* the article's own headline is right below, as with iOS large titles */
  .lights { display: none; }
  .navback { display: block; position: absolute; left: 8px; bottom: 9px; padding: 6px; color: #1a7cf0; font-size: 16px; font-weight: 500; text-decoration: none; }
  footer.legal { background: var(--win); color: var(--text-soft); text-shadow: none; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .numbers { grid-template-columns: 1fr; }
  .num { display: grid; grid-template-columns: 92px 1fr; align-items: center; text-align: left; gap: 12px; padding: 14px; }
  .num b { margin: 0; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.facts mark.tc { white-space: normal; display: inline-block; margin-top: 6px; }

/* Photo case studies: portrait (3:4) frames */
.pair.photo { max-width: 680px; }
.pair.photo img, .gallery img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0; }
.gallery figure { margin: 0; }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

/* Services page: the "What I do" copy as one long page (same before/after strips and feature grid as the window) */
.toc ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.toc a:hover { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.svc { scroll-margin-top: 80px; border-top: 1px solid var(--line); margin-top: 40px; }
.svc .eyebrow { margin-top: 32px; }
.svc h2 { margin-top: 0; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; }
.ba p { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.5; background: var(--card); color: var(--text-soft); }
.ba p.after { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.ba span { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.ba p.after span { color: var(--accent-ink); }
.feats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.feats li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.45; color: var(--text-soft); margin: 0; }
.feats li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); }
.feats b { display: block; font-weight: 600; color: var(--text); }
.more { font-weight: 600; text-decoration: none; }
@media (max-width: 600px) { .ba, .feats { grid-template-columns: 1fr; } }
