/* samcloud.online
   Two palettes at the top, then the page in the order it appears.
   No framework, no build step. */

:root {
  --ink-900: #0a0e16;
  --ink-800: #10151f;
  --ink-750: #151b27;
  --ink-700: #1a2130;

  --line:    #222b3b;
  --line-2:  #2e3849;

  --paper:   #e4e8f0;
  --muted:   #9aa5b8;
  --dim:     #6f7b8f;

  --violet:  #7c5cff;
  --azure:   #4aa8f0;
  --green:   #4fd76a;
  --brass:   #c9a760;

  --wrap: 1120px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: dark;
}

[data-theme="light"] {
  --ink-900: #f4f1e9;
  --ink-800: #fffdf8;
  --ink-750: #faf7f0;
  --ink-700: #f1ece1;

  --line:    #e2dacb;
  --line-2:  #cec3ae;

  --paper:   #171c26;
  --muted:   #545e6e;
  --dim:     #7a8393;

  --violet:  #5334c9;
  --azure:   #0d63ae;
  --green:   #1c8039;
  --brass:   #8d6a2c;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }

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

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
::selection { background: var(--violet); color: #fff; }

:focus-visible { outline: 2px solid var(--azure); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; z-index: 100; padding: 12px 18px; background: var(--violet); color: #fff; }
.skip:focus { left: 12px; top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 26px; }
.mono { font-family: var(--mono); }

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.012em;
}
p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--paper); }

/* --- sections ---------------------------------------------------------- */
.sec { padding: clamp(68px, 9vw, 112px) 0; }
.sec--tint { background: var(--ink-800); border-block: 1px solid var(--line); }

.sec__head { max-width: 46em; margin-bottom: clamp(38px, 5vw, 58px); }
.sec__head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.sec__head p { margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.sec__head--left { margin-bottom: 26px; }

/* --- buttons and links ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .2s, background-color .2s, color .2s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { border-color: var(--violet); background: var(--violet); color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--violet) 84%, #000); border-color: color-mix(in srgb, var(--violet) 84%, #000); }
.btn--ghost:hover { border-color: var(--paper); }
.btn--sm { padding: 8px 15px; font-size: 14px; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--azure);
  border-bottom: 1px solid color-mix(in srgb, var(--azure) 40%, transparent);
  padding-bottom: 2px;
}
.link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.link:hover { color: var(--paper); border-color: var(--paper); }

/* --- nav --------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--ink-900) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 22px; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { width: 34px; height: 34px; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-family: var(--sans); font-size: 14.5px; font-weight: 700; letter-spacing: .09em; }
.brand__dash { color: var(--violet); }
.brand__text small { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--dim); }

.nav__links { display: flex; gap: 2px; }
.nav__links a { padding: 8px 12px; border-radius: 6px; font-size: 14.5px; color: var(--muted); }
.nav__links a:hover, .nav__links a.is-active { color: var(--paper); }

.nav__end { display: flex; align-items: center; gap: 9px; }

.theme { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--line-2); border-radius: 7px; color: var(--muted); }
.theme:hover { color: var(--paper); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme__moon { display: none; }
[data-theme="light"] .theme__sun { display: none; }
[data-theme="light"] .theme__moon { display: block; }

.burger { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 35px; height: 35px; border: 1px solid var(--line-2); border-radius: 7px; }
.burger span { width: 15px; height: 1.5px; background: var(--paper); transition: transform .25s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.menu { display: none; flex-direction: column; padding: 4px 26px 18px; border-top: 1px solid var(--line); background: var(--ink-800); }
.menu a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.menu a:last-child { border-bottom: 0; }

/* --- hero -------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(72px, 10vw, 118px) 0 clamp(58px, 8vw, 92px);
  isolation: isolate;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: -8%; z-index: -1; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(46px) saturate(120%); transform: scale(1.2); opacity: .7; }
[data-theme="light"] .hero__bg img { opacity: .22; filter: blur(52px) brightness(1.6); }
.hero__vign {
  position: absolute; inset: 0;
  background:
    radial-gradient(115% 90% at 30% 10%, transparent 10%, var(--ink-900) 80%),
    linear-gradient(180deg, transparent 40%, var(--ink-900) 96%);
}

.hero__in { max-width: 780px; }
.hero__title { font-size: clamp(38px, 6vw, 68px); line-height: 1.06; letter-spacing: -.025em; }
.hero__lede { max-width: 56ch; margin-top: 24px; font-size: clamp(16px, 1.3vw, 18px); color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* --- framed pictures --------------------------------------------------- */
.plate-sec { padding-bottom: clamp(48px, 6vw, 72px); }
.plate__frame { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-800); }
.plate__frame img { width: 100%; border-radius: 4px; }
.plate__cap { margin-top: 12px; font-size: 13.5px; color: var(--dim); }

/* --- the numbers ------------------------------------------------------- */
.ledger-sec { padding-bottom: clamp(20px, 3vw, 34px); }
.ledger { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger__item { padding: 24px 22px; border-left: 1px solid var(--line); }
.ledger__item:first-child { border-left: 0; padding-left: 0; }
.ledger dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.ledger dd { margin: 6px 0 0; font-family: var(--serif); font-size: clamp(30px, 3.6vw, 40px); line-height: 1; }
.ledger .zero { color: var(--green); }

/* --- the apps ---------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: start;
  gap: clamp(36px, 5vw, 66px);
  padding: clamp(46px, 5vw, 66px) 0;
  border-top: 1px solid var(--line);
}
.app:first-of-type { border-top: 0; padding-top: 0; }
.app--flip .app__body { order: 2; }
.app__body p { color: var(--muted); font-size: 16.2px; max-width: 54ch; }

.app__idx { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.app__name { margin-bottom: 18px; font-size: clamp(27px, 3.2vw, 36px); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.spec > div { padding: 12px 14px; background: var(--ink-800); }
.spec dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.spec dd { margin: 5px 0 0; font-size: 14px; }

.caveat {
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 2px solid var(--brass);
  font-size: 14.5px;
  color: var(--muted) !important;
}
.caveat .mono { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brass); }

.app__art { position: relative; display: grid; place-items: start center; }

.phone { width: min(240px, 74%); padding: 8px; border: 1px solid var(--line-2); border-radius: 28px; background: var(--ink-700); }
.phone img { width: 100%; border-radius: 21px; }

.screen { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background: var(--ink-750); overflow: hidden; }
.screen__bar { display: flex; gap: 6px; padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--ink-700); }
.screen__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.screen img { width: 100%; }

/* --- how I work -------------------------------------------------------- */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.rule { padding: 28px 26px; background: var(--ink-900); }
[data-theme="light"] .rule { background: var(--ink-750); }
.rule h3 { font-size: 19px; }
.rule p { margin: 11px 0 0; font-size: 15px; color: var(--muted); }

/* --- tools ------------------------------------------------------------- */
.stack { display: grid; grid-template-columns: 1.05fr .95fr; align-items: start; gap: clamp(36px, 5vw, 62px); }

.term { border: 1px solid var(--line-2); border-radius: 8px; background: #0b0f18; overflow: hidden; }
[data-theme="light"] .term { background: #101623; border-color: #29334a; }
.term__bar { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-bottom: 1px solid #1c2434; background: #10161f; }
.term__dots { display: flex; gap: 6px; }
.term__dots i { width: 9px; height: 9px; border-radius: 50%; background: #2c3648; }
.term__title { font-size: 11.5px; color: #5f6d86; }

.term__body {
  margin: 0;
  padding: 20px 18px 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  color: #c2cddf;
  white-space: pre-wrap;
  word-break: break-word;
}
.term__body .c { color: var(--green); }
.term__body .d { color: #6cb6ef; }
.term__body .o { color: #8896ac; }
.term__body .g { color: var(--green); }
.cursor { color: var(--green); animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; }
.tag { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 5px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tag--hd { border-color: transparent; padding-left: 0; min-width: 62px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }

/* --- the name ---------------------------------------------------------- */
.arcade { position: relative; padding: clamp(80px, 10vw, 124px) 0; border-block: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.arcade__art { position: absolute; inset: 0; z-index: -1; }
.arcade__art img { width: 100%; height: 100%; object-fit: cover; }
.arcade__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 11, 18, .95) 20%, rgba(8, 11, 18, .72) 70%, rgba(8, 11, 18, .85)),
    linear-gradient(180deg, rgba(8, 11, 18, .8), rgba(8, 11, 18, .6) 40%, rgba(8, 11, 18, .9));
}
.arcade__in { position: relative; max-width: 640px; color: #e4e8f0; }
.arcade__in h2 { font-size: clamp(28px, 3.6vw, 40px); }
.arcade__in p { margin-top: 18px; color: #a3aec2; }

/* --- about ------------------------------------------------------------- */
.about { display: grid; grid-template-columns: .9fr 1.1fr; align-items: start; gap: clamp(36px, 5vw, 62px); }
.about__body p { color: var(--muted); }
.facts { margin-top: 28px; border-top: 1px solid var(--line); }
.facts li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.facts .mono { flex: none; min-width: 92px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); line-height: 2.1; }

/* --- contact ----------------------------------------------------------- */
.cta { max-width: 44em; }
.cta h2 { font-size: clamp(26px, 3.2vw, 36px); }
.cta p { margin-top: 16px; color: var(--muted); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.cta__actions .btn--primary { font-family: var(--mono); font-size: 14px; }
.cta__fine { margin-top: 18px; font-size: 12px; color: var(--dim); }

/* --- footer ------------------------------------------------------------ */
.foot { border-top: 1px solid var(--line); background: var(--ink-800); }
.foot__in { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 38px; padding-block: clamp(44px, 6vw, 62px) 38px; }
.foot__tag { margin-top: 18px; font-size: 14px; color: var(--dim); line-height: 1.7; }
.foot__col h3 { margin-bottom: 15px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }
.foot__col a { display: block; margin-bottom: 9px; font-size: 14.5px; color: var(--muted); word-break: break-word; }
.foot__col a:hover { color: var(--paper); }
.foot__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 18px 26px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }
.foot__bar p { margin: 0; }
.foot__bar .mono { font-size: 11.5px; }

/* --- a quiet fade as things come into view ----------------------------- */
.js .reveal { opacity: 0; transition: opacity .55s ease; }
.js .reveal.in { opacity: 1; }

/* --- the konami code --------------------------------------------------- */
.invaders { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.invader { position: absolute; top: -40px; width: 22px; height: 22px; color: var(--green); animation: fall linear forwards; }
.invader svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes fall { to { transform: translateY(112vh) rotate(16deg); opacity: 0; } }

body.arcade-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(79, 215, 106, .06) 0 1px, transparent 1px 3px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--ink-700);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--paper);
  opacity: 0;
  transition: opacity .25s, transform .25s;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* --- narrower screens -------------------------------------------------- */
@media (max-width: 1020px) {
  .rules { grid-template-columns: repeat(2, 1fr); }
  .foot__in { grid-template-columns: 1fr 1fr; gap: 34px; }
}

@media (max-width: 920px) {
  .nav__links { display: none; }
  .burger { display: flex; }
  .nav__end .btn--sm { display: none; }
  .menu.is-open { display: flex; }

  .app, .stack, .about { grid-template-columns: 1fr; gap: 38px; }
  .app--flip .app__body { order: 0; }
  .app__art { order: -1; justify-items: start; }
  .about__fig { order: -1; max-width: 560px; }
  .phone { width: min(215px, 58%); }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 78px; }
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger__item { padding: 18px 16px; border-left: 0; border-top: 1px solid var(--line); }
  .ledger__item:nth-child(-n+2) { border-top: 0; }
  .ledger__item:nth-child(odd) { padding-left: 0; }
  .ledger__item:nth-child(even) { border-left: 1px solid var(--line); }
  .rules { grid-template-columns: 1fr; }
  .foot__in { grid-template-columns: 1fr; gap: 30px; }
  .foot__bar { flex-direction: column; }
}

@media (max-width: 460px) {
  .brand__text small { display: none; }
  .spec { grid-template-columns: 1fr 1fr; }
  .term__body { font-size: 11px; padding: 16px 14px 20px; }
  .facts .mono { min-width: 100%; line-height: 1.5; }
  .cta__actions .btn { width: 100%; justify-content: center; }
  .cta__actions .btn--primary { font-size: 12.5px; }
}

/* --- people who'd rather things didn't move ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; }
}

@media print {
  .nav, .menu, .theme, .burger, .invaders, .hero__bg, .arcade__art { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sec { padding: 18px 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
