/* CodeSSH — shared design system.
   Reference: cursor.com. Structure and layout follow theirs; the palette
   is a near-black neutral ramp with only a trace of warmth, so the page
   reads black rather than brown. Colour is reserved for the product:
   the device finishes, the field behind it and the syntax palette.
   Every page loads this file. */

/* ═══════════ TOKENS ═══════════ */
:root,[data-theme="dark"]{
  --bg:#000000;
  --bg-2:#08080A;
  --surface:#121214;
  --surface-2:#1A1A1D;
  --raised:#242427;

  --text:#FFFFFF;
  --text-2:#9E9EA6;
  --text-3:#65656D;

  --accent:#F2F2F3;       /* monochrome: the marks read as ink, not colour */
  --green:#8FBF6B;
  --ios:#0A84FF;          /* iOS system blue, for chrome inside the app mockups */

  /* Xcode Dark, for the product's own surfaces */
  --kw:#FF7AB2; --str:#FF8A7A; --num:#D9C97C; --com:#7F8C98;
  --typ:#D8A9FF; --fn:#7BD4C0; --pln:#E4E6EA;

  --sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;

  --ease:cubic-bezier(.16,1,.3,1);
  --spring:cubic-bezier(.2,.9,.25,1);
  --fast:160ms;
  --pad:clamp(20px,5vw,44px);
  --max:1340px;
  --gap:clamp(80px,9.5vw,148px);
  --shadow:0 1px 2px rgba(0,0,0,.5),0 12px 30px -16px rgba(0,0,0,.8);
  --shadow-lg:0 2px 8px rgba(0,0,0,.55),0 30px 64px -28px rgba(0,0,0,.9);
  --grain:.02;
  --nav-bg:rgba(8,9,10,.72);
  --mark-a:#141417;
  --mark-b:#26262C;
  --term-accent:#FFFFFF;   /* the prompt reads by weight, not by hue */
}

/* ═══════════ LIGHT THEME ═══════════ */
/* the same system inverted through its tokens. app screens, the device frame
   and the terminal stay dark on purpose: that is what they actually look like. */
[data-theme="light"]{
  --bg:#FFFFFF;
  --bg-2:#F7F7F8;
  --surface:#F4F4F6;
  --surface-2:#EBEBEE;
  --raised:#E1E1E5;

  --text:#0A0A0B;
  --text-2:#5C5C63;
  --text-3:#8A8A92;

  --accent:#0A0A0B;        /* monochrome */

  --shadow:0 1px 2px rgba(16,16,20,.06),0 10px 26px -14px rgba(16,16,20,.18);
  --shadow-lg:0 2px 6px rgba(16,16,20,.07),0 26px 56px -26px rgba(16,16,20,.24);
  --grain:.012;
  --nav-bg:rgba(255,255,255,.78);
  --mark-a:#EDEDF0;
  --mark-b:#DBDBE1;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;border:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:16px;line-height:1.55;
  letter-spacing:-.011em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;font-optical-sizing:auto}
::selection{background:rgba(255,255,255,.18)}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;cursor:pointer}
:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--accent);border-radius:8px}

/* film grain, the way both references finish a dark canvas */
body::before{content:"";position:fixed;inset:0;z-index:400;pointer-events:none;opacity:var(--grain);
  background-size:170px 170px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}

.wrap{width:100%;max-width:var(--max);margin-inline:auto;padding-inline:var(--pad);position:relative;z-index:2}
section{padding-block:var(--gap);position:relative}

/* ═══════════ TYPE ═══════════ */
h1,h2,h3{font-weight:600}
.h1{font-size:clamp(2.5rem,5.6vw,4.3rem);line-height:1.05;letter-spacing:-.038em}
.h2{font-size:clamp(1.8rem,3.6vw,2.65rem);line-height:1.1;letter-spacing:-.032em}
.h3{font-size:17px;line-height:1.35;letter-spacing:-.018em}
.lede{font-size:clamp(.95rem,1.15vw,1.05rem);line-height:1.62;color:var(--text-2);letter-spacing:-.008em}
.body{font-size:15px;line-height:1.62;color:var(--text-2);letter-spacing:-.008em}
.fine{font-size:13px;line-height:1.5;color:var(--text-3);letter-spacing:0}

.label{display:inline-flex;align-items:center;height:28px;padding:0 13px;border-radius:99px;
  font-size:12.5px;font-weight:500;letter-spacing:-.005em;color:var(--text-2);background:var(--surface)}

.lnk{color:var(--text);display:inline-flex;align-items:center;gap:5px;font-size:14px;font-weight:500;
  transition:color var(--fast) ease}
.lnk:hover{color:var(--text)}
.lnk svg{transition:transform var(--fast) ease}
.lnk:hover svg{transform:translateX(3px)}

/* a colour gradient that never stops travelling, used on three headings
   only. every stop clears 3:1 on both band colours, so it stays legible. */
@keyframes gradflow{to{background-position:100% 50%}}
/* two complete cycles across the image: a 100% position shift moves it by
   exactly one cycle, so the loop point is an identical frame and never flashes */
.grad{background:linear-gradient(100deg,
    #2F5BD8 0%,#6B3FD0 12.5%,#A93B96 25%,#C23B6E 37.5%,
    #2F5BD8 50%,#6B3FD0 62.5%,#A93B96 75%,#C23B6E 87.5%,#2F5BD8 100%);
  background-size:200% 100%;background-position:0 50%;
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  animation:gradflow 26s linear infinite}
@media(prefers-reduced-motion:reduce){.grad{animation:none}}

/* ═══════════ MOTION ═══════════ */
/* headings and subtitles assemble a word at a time. no overflow clipping,
   so a line that wraps on a narrow screen still animates cleanly. */
.w{display:inline-block;opacity:0;transform:translateY(.42em);
  transition:opacity .5s ease calc(var(--d,0ms) + var(--wd,0ms)),
             transform .72s var(--ease) calc(var(--d,0ms) + var(--wd,0ms))}
.in .w{opacity:1;transform:none}
[data-mask="soft"] .w{transform:translateY(.2em);
  transition:opacity .44s ease calc(var(--d,0ms) + var(--wd,0ms)),
             transform .5s var(--ease) calc(var(--d,0ms) + var(--wd,0ms))}
[data-r]{opacity:0;transform:translateY(12px)}
[data-r].in{opacity:1;transform:none;
  transition:opacity .5s ease var(--d,0ms),transform .62s var(--ease) var(--d,0ms)}

/* ═══════════ NAV ═══════════ */
.nav{position:fixed;inset:0 0 auto 0;z-index:90;height:60px;display:flex;align-items:center;
  transition:box-shadow var(--fast) ease}
.nav::after{content:"";position:absolute;inset:0;z-index:-1;background:var(--nav-bg);
  backdrop-filter:blur(14px) saturate(150%);-webkit-backdrop-filter:blur(14px) saturate(150%);
  opacity:0;transition:opacity .3s ease}
.nav.on::after{opacity:1}

.nav__in{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;width:100%;
  max-width:var(--max);margin-inline:auto;padding-inline:var(--pad)}
.mark{justify-self:start;display:flex;align-items:center;gap:9px;font-size:14.5px;font-weight:600;letter-spacing:-.02em}
@keyframes blink{0%,55%{opacity:1}56%,100%{opacity:.12}}
.nav__l{justify-self:center;display:flex;gap:4px}
.nav__l a{font-size:13.5px;color:var(--text-2);padding:6px 11px;border-radius:7px;
  transition:color var(--fast) ease,background var(--fast) ease}
.nav__l a:hover{color:var(--text);background:var(--surface)}
.nav__r{justify-self:end;display:flex;align-items:center;gap:10px}
.tgl{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;
  color:var(--text-2);transition:color var(--fast) ease,background var(--fast) ease}
.tgl:hover{color:var(--text);background:var(--surface)}
.tgl svg{display:block}
.tgl .sun{display:none}
[data-theme="light"] .tgl .sun{display:block}
[data-theme="light"] .tgl .moon{display:none}
/* 40px is Apple's onscreen minimum; the 60px bar clears their quarter-height rule */
.badge--sm{height:40px}
.badge--sm.is-fallback .badge__fb{padding:0 14px;font-size:13px;border-radius:7px}
@media(max-width:760px){.nav__l{display:none}}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:42px;padding:0 20px;
  border-radius:8px;font-size:14px;font-weight:500;letter-spacing:-.006em;
  background:var(--text);color:var(--bg);
  transition:opacity var(--fast) ease,transform var(--fast) ease}
.btn:hover{opacity:.88}
.btn:active{transform:scale(.985)}
.btn--ghost{background:var(--surface);color:var(--text)}
.btn--ghost:hover{background:rgba(240,232,212,.08)}
/* the arrow links that sit beside the primary call to action */
.arrow{display:inline-flex;align-items:center;gap:6px;height:42px;padding:0 4px;
  font-size:14px;font-weight:450;color:var(--text-2);transition:color var(--fast) ease}
.arrow:hover{color:var(--text)}
.arrow span{transition:transform var(--fast) ease}
.arrow:hover span{transform:translateX(3px)}
.actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:34px}
/* Apple's own artwork, unmodified, served from their marketing endpoint.
   Rendered at 46px tall: their onscreen minimum is 40px, and the 18px gap in
   .actions clears their required quarter-height of clear space. */
.badge{display:inline-flex;height:46px;transition:transform var(--fast) ease,opacity var(--fast) ease}
.badge img{height:100%;width:auto;display:block}
.badge:hover{opacity:.9;transform:translateY(-2px)}
.badge:active{transform:translateY(0) scale(.985)}
.badge__fb{display:none}
.badge.is-fallback img{display:none}
.badge.is-fallback .badge__fb{display:inline-flex;align-items:center;height:100%;padding:0 20px;
  border-radius:8px;background:var(--text);color:var(--bg);font-size:14px;font-weight:500}
.cta .actions{justify-content:center}

/* ═══════════ TESTIMONIALS ═══════════ */
.quotes{columns:3;column-gap:12px;margin-top:clamp(34px,4.5vw,52px)}
.quote{break-inside:avoid;margin-bottom:12px;background:var(--surface);border-radius:14px;padding:24px;
  box-shadow:var(--shadow)}
.quote p{font-size:14.5px;line-height:1.62;color:var(--text-2);letter-spacing:-.008em}
.quote footer{margin-top:16px;font-size:13px;color:var(--text)}
.quote footer span{display:block;color:var(--text-3);font-size:12.5px;margin-top:2px}
@media(max-width:900px){.quotes{columns:2}}
@media(max-width:640px){.quotes{columns:1}}


/* ═══════════ CONTENT PAGES ═══════════ */
.page{padding-top:136px;padding-bottom:clamp(68px,8vw,116px)}
.page__head{max-width:44rem}
.page__head .h1{margin:20px 0 20px}
.page__meta{margin-top:20px;font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;color:var(--text-3)}
.doc{display:grid;grid-template-columns:224px 1fr;gap:clamp(30px,5vw,104px);
  margin-top:clamp(52px,6vw,86px);align-items:start}
.toc{position:sticky;top:88px}
.toc a{display:block;font-size:13px;line-height:1.4;color:var(--text-3);padding:6px 10px;border-radius:6px;
  transition:color var(--fast) ease,background var(--fast) ease}
.toc a:hover{color:var(--text-2)}
.toc a.on{color:var(--text);background:var(--surface)}
.prose{max-width:42rem}
.prose section{padding:0;scroll-margin-top:88px}
.prose section::before,.prose section::after{display:none}
.prose section+section{margin-top:clamp(58px,6.5vw,86px)}

/* documentation scale: a section title, not a chapter opener */
.prose h2{font-size:22px;font-weight:600;letter-spacing:-.022em;line-height:1.25;
  margin:0 0 18px;color:var(--text);scroll-margin-top:88px}
.prose h2 .anchor{margin-left:9px;font-family:var(--mono);font-size:15px;font-weight:400;
  color:var(--text-3);opacity:0;transition:opacity var(--fast) ease}
.prose h2:hover .anchor,.prose h2 .anchor:focus-visible{opacity:1}
.prose h3{font-size:15px;font-weight:600;letter-spacing:-.014em;color:var(--text);margin:32px 0 10px}
.prose h3+p{margin-top:0}
.prose p{font-size:15px;line-height:1.7;color:var(--text-2);letter-spacing:-.006em}
.prose p+p{margin-top:14px}
.prose p>strong:first-child{color:var(--text)}
.prose ul{list-style:none;margin-top:16px;display:flex;flex-direction:column;gap:11px}
.prose li{font-size:15px;line-height:1.66;color:var(--text-2);padding-left:20px;position:relative}
.prose li::before{content:"";position:absolute;left:0;top:.72em;width:6px;height:1.5px;
  border-radius:1px;background:var(--text-3)}
.prose strong{color:var(--text);font-weight:500}
.prose code{font-family:var(--mono);font-size:13px;color:var(--text);
  background:var(--surface-2);padding:2px 6px;border-radius:5px}
.prose em{font-style:normal;color:var(--text)}
/* keyboard shortcuts read as keys */
kbd{display:inline-block;font-family:var(--mono);font-size:12px;line-height:1;padding:4px 7px;
  border-radius:5px;background:var(--surface-2);color:var(--text);white-space:nowrap;
  box-shadow:0 1px 0 rgba(0,0,0,.6)}
.prose table{width:100%;border-collapse:collapse;margin:20px 0 4px;font-size:14px;
  border-radius:10px;overflow:hidden}
.prose thead th{text-align:left;font-weight:500;color:var(--text);padding:11px 16px;
  background:var(--surface-2);white-space:nowrap}
.prose td{padding:11px 16px;color:var(--text-2);vertical-align:top;line-height:1.55}
.prose td:first-child{white-space:nowrap}
.prose tbody tr:nth-child(odd) td{background:var(--surface)}
.prose td code{font-size:12.5px;background:transparent;padding:0}
.prose td kbd{font-size:11.5px}

/* documentation header, not a marketing hero */
.docs{padding-top:124px;padding-bottom:clamp(68px,8vw,116px)}
.docs__top{padding-bottom:clamp(28px,3.5vw,44px)}
.docs__top .h1{font-size:clamp(1.9rem,3.2vw,2.5rem);margin:16px 0 14px}
.docs__top .lede{max-width:38rem}

/* sidebar grouped by area */
.toc--doc .toc__g{margin-bottom:20px}
.toc--doc .toc__g>span{display:block;font-family:var(--mono);font-size:10.5px;letter-spacing:.09em;
  text-transform:uppercase;color:var(--text-3);padding:0 10px 7px}
.toc--doc a{font-size:13.5px;padding:6px 10px}
.note{margin-top:22px;background:var(--surface);border-radius:14px;padding:20px 22px}
/* legal pages: a summary up front, numbered sections, tables that scroll on narrow screens */
.summary{background:var(--surface);border-radius:14px;padding:22px 24px 24px;margin-bottom:clamp(44px,5vw,60px)}
.summary__k{display:block;font-family:var(--mono);font-size:11px;letter-spacing:.09em;text-transform:uppercase;
  color:var(--text-3);margin-bottom:14px}
.summary ul{margin-top:0}
.prose h2 .sn{font-family:var(--mono);font-size:.7em;font-weight:500;color:var(--text-3);margin-right:12px;
  letter-spacing:0;vertical-align:.12em}
.toc--num a{display:flex;gap:10px;align-items:baseline}
.toc--num a span{flex:none;width:16px;font-family:var(--mono);font-size:11px;color:var(--text-3)}
.toc--num a.on span{color:var(--text)}
.tbl{overflow-x:auto;margin:22px 0 4px;border-radius:10px}
.tbl table{margin:0;min-width:520px}
.prose td .ex{display:block;margin-top:3px;font-size:12.5px;line-height:1.45;color:var(--text-3)}
.prose td code{font-size:12.5px;overflow-wrap:anywhere}
.note p{color:var(--text-2)}
@media(max-width:820px){.doc{grid-template-columns:1fr}.toc{position:static;display:flex;flex-wrap:wrap;gap:0 6px}}

.grid2{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:clamp(34px,4.5vw,52px)}
.grid2>div{background:var(--surface);border-radius:14px;padding:22px 24px;box-shadow:var(--shadow)}
.grid2 dt{margin-bottom:10px}
.grid2 dd{font-size:14.5px;line-height:1.6;letter-spacing:-.01em;color:var(--text-2)}
@media(max-width:720px){.grid2{grid-template-columns:1fr 1fr}}

.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:clamp(34px,4.5vw,52px);
  margin-bottom:clamp(8px,1.5vw,20px)}
.card{display:block;background:var(--surface);border-radius:14px;padding:26px 26px 28px;box-shadow:var(--shadow);
  transition:background var(--fast) ease,transform var(--fast) ease}
.card:hover{background:var(--surface-2);transform:translateY(-2px)}
.card h3{font-size:15.5px;font-weight:600;letter-spacing:-.018em;margin:14px 0 6px}
.card p{font-size:14px;line-height:1.58;color:var(--text-2)}
.card .lnk{display:flex;width:max-content;font-size:13.5px;margin-top:15px;color:var(--text-2)}
@media(max-width:760px){.cards{grid-template-columns:1fr}}

/* ═══════════ CTA + FOOT ═══════════ */
.cta{text-align:center;padding-block:clamp(96px,12vw,160px);background:var(--bg-2)}
.cta .h2{font-size:clamp(1.9rem,4vw,2.9rem)}
.cta .btn{margin-top:30px}
.cta .badge{margin-top:38px;margin-bottom:6px}
.foot{padding-block:clamp(52px,6vw,76px) 32px;position:relative;background:var(--bg-2)}
.foot__cols{display:grid;grid-template-columns:1.4fr repeat(4,1fr);gap:28px}
.foot__cols h4{font-size:13px;font-weight:500;color:var(--text);margin-bottom:14px}
.foot__cols ul{list-style:none;display:flex;flex-direction:column;gap:9px}
.foot a{font-size:13px;color:var(--text-3);transition:color var(--fast) ease}
.foot a:hover{color:var(--text)}
.foot__brand .mark{margin-bottom:12px}
/* iOS rounds app icons at about 22.4% of the side */
.mark img{width:22px;height:22px;border-radius:4.9px;display:block;flex:none;
  box-shadow:0 0 0 .5px rgba(128,128,128,.22)}
.press__icon{width:88px;height:88px;border-radius:19.7px;display:block;margin-bottom:26px;
  box-shadow:var(--shadow)}
.foot__brand .mark img{width:26px;height:26px;border-radius:6px}
.foot__brand p{font-size:13px;line-height:1.55;color:var(--text-3);max-width:26ch}
.foot__mark{margin-top:clamp(44px,5vw,70px);font-size:clamp(3.4rem,13vw,10.5rem);font-weight:600;
  letter-spacing:-.055em;line-height:.82;user-select:none;pointer-events:none;
  /* two cycles across the image so the loop point is an identical frame */
  background:linear-gradient(104deg,
    var(--mark-a) 0%,var(--mark-b) 12.5%,var(--mark-a) 25%,var(--mark-b) 37.5%,
    var(--mark-a) 50%,var(--mark-b) 62.5%,var(--mark-a) 75%,var(--mark-b) 87.5%,var(--mark-a) 100%);
  background-size:200% 100%;background-position:0 50%;
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  animation:gradflow 22s linear infinite;
  -webkit-mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.18) 100%);
  mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.18) 100%)}
@media(prefers-reduced-motion:reduce){.foot__mark{animation:none}}
.foot__in{display:flex;align-items:center;gap:22px;flex-wrap:wrap;margin-top:clamp(30px,3.5vw,44px)}
.foot__l{display:flex;gap:20px;margin-left:auto}
@media(max-width:860px){.foot__cols{grid-template-columns:1fr 1fr;gap:32px}}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  html{scroll-behavior:auto}
  [data-r],.w{opacity:1!important;transform:none!important}
}
