/* eclectek.com — main stylesheet */

:root {
  --paper: #F4F2EC;
  --surface: #FFFFFF;
  --sunk: #ECE9E1;
  --ink: #16151A;
  --ink-2: #46444D;
  --ink-3: #6A6772;
  --rule: #DCD8CE;
  --rule-2: #C7C2B6;

  /* The three worlds */
  --trail: #1E7A4C;
  --table: #2458D8;
  --wall: #C8402F;

  --live: #1E7A4C;
  --soon: #9A5B00;

  /* Background code colors */
  --code-x: #8E8A95;
  --code-k: #8A2BE2;
  --code-s: #12924F;
  --code-n: #E07800;
  --code-f: #1F5BFF;
  --code-p: #E5402C;
  --code-c: #A9A497;
  --code-g: #C4BFB3;
  --code-opacity: .17;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --shadow: 0 1px 2px rgb(22 21 26 / .05), 0 14px 32px -18px rgb(22 21 26 / .28);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111014;
    --surface: #1A191F;
    --sunk: #16151A;
    --ink: #F2F0EA;
    --ink-2: #BDB9B0;
    --ink-3: #908C96;
    --rule: #2D2B34;
    --rule-2: #3D3A45;
    --trail: #4FC58A;
    --table: #7FA6FF;
    --wall: #FF7E6B;
    --live: #4FC58A;
    --soon: #F2B84B;
    --code-x: #77737F;
    --code-k: #B98CFF;
    --code-s: #4FD48C;
    --code-n: #FFAA45;
    --code-f: #78A3FF;
    --code-p: #FF7A66;
    --code-c: #5E5B66;
    --code-g: #46434E;
    --code-opacity: .28;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -20px rgb(0 0 0 / .7);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2.5px solid var(--table); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 10; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Faded code wallpaper ----------
   A fixed page of make-believe code the site scrolls over.
   Edit the code itself in index.html (the .codebg block). */

.codebg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: var(--code-opacity);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
}
.codebg pre {
  width: min(100% - 2 * var(--gutter), 1400px);
  margin: 0 auto;
  padding-top: 92px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.9;
  color: var(--code-x);
  white-space: normal;
  counter-reset: ln;
}
@media (min-width: 1100px) {
  .codebg pre { columns: 2; column-gap: 72px; font-size: 14px; }
}
@media (max-width: 640px) {
  .codebg { opacity: calc(var(--code-opacity) * .8); }
  .codebg pre { font-size: 10px; padding-top: 74px; }
}
.codebg b { display: block; white-space: pre; font-weight: inherit; counter-increment: ln; break-inside: avoid; }
.codebg b::before {
  content: counter(ln);
  display: inline-block;
  width: 3ch;
  margin-right: 2.5ch;
  text-align: right;
  color: var(--code-g);
}
.codebg i { font-style: normal; }
.codebg .k { color: var(--code-k); }
.codebg .s { color: var(--code-s); }
.codebg .n { color: var(--code-n); }
.codebg .f { color: var(--code-f); }
.codebg .p { color: var(--code-p); }
.codebg .c { color: var(--code-c); font-style: italic; }

/* Text that sits right on the code gets a soft paper glow, so the code clears around the letters */
.site-header, .hero .eyebrow, .hero .lede, .section-head, .world-head, .site-footer {
  text-shadow: 0 0 4px var(--paper), 0 0 10px var(--paper), 0 0 18px var(--paper);
}

@media print { .codebg { display: none; } }

/* ---------- Header ---------- */

.site-header { padding-block: 22px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -0.03em;
}
.brand img { width: 28px; height: 28px; }

.nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.nav a {
  text-decoration: none;
  font-weight: 550;
  font-size: 15.5px;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(36px, 7vw, 88px) clamp(56px, 9vw, 112px); }
.hero .wrap {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
@media (min-width: 920px) {
  .hero .wrap { grid-template-columns: 1.25fr 1fr; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 5.1rem);
  line-height: .98;
  letter-spacing: -0.04em;
  font-weight: 760;
  text-wrap: balance;
  margin-top: 18px;
}
.hero h1 .w { white-space: nowrap; }
.hero h1 .w-trail { color: var(--trail); }
.hero h1 .w-table { color: var(--table); }
.hero h1 .w-wall  { color: var(--wall); }

.hero .lede {
  margin-top: 24px;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 38ch;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform .15s ease, background-color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }

/* Icon shelf */
.shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.4vw, 26px);
  padding: clamp(18px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.shelf a {
  display: grid; justify-items: center; gap: 10px;
  text-decoration: none;
}
.shelf img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 23%;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 10px 22px -12px rgb(0 0 0 / .45);
  transition: transform .2s cubic-bezier(.3, .7, .4, 1.4);
}
.shelf a:hover img, .shelf a:focus-visible img { transform: translateY(-5px) rotate(-4deg); }
.shelf a:nth-child(even):hover img, .shelf a:nth-child(even):focus-visible img { transform: translateY(-5px) rotate(4deg); }
.shelf span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.2;
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 {
  margin-top: 12px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 740;
  text-wrap: balance;
}
.section-head p {
  margin-top: 16px;
  font-size: 1.12rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Worlds (app groups) */
.world { border-top: 1.5px solid var(--ink); padding-top: 22px; }
.world + .world, .worlds-duo { margin-top: clamp(48px, 6vw, 72px); }

.world-head { margin-bottom: 26px; display: grid; gap: 8px; align-content: start; }
@media (min-width: 760px) {
  .world-head { grid-template-columns: minmax(220px, 1fr) 1.6fr; column-gap: 40px; }
  .world-head .eyebrow { grid-column: 1; grid-row: 1; }
  .world-head h3 { grid-column: 1; grid-row: 2; }
  .world-head p:not(.eyebrow) { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
}
.world-head .eyebrow { color: var(--world); }
.world-head h3 { font-size: 1.75rem; letter-spacing: -0.025em; font-weight: 720; line-height: 1.1; }
.world-head p { color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }

.world-trail { --world: var(--trail); }
.world-table { --world: var(--table); }
.world-wall  { --world: var(--wall); }

.worlds-duo { display: grid; gap: clamp(48px, 6vw, 72px); }
@media (min-width: 920px) {
  /* Side by side, with headings and cards lined up across both columns */
  .worlds-duo { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 32px; row-gap: 0; }
  .worlds-duo .world { margin-top: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; }
  .worlds-duo .world-head { grid-template-columns: 1fr; }
  .worlds-duo .world-head .eyebrow,
  .worlds-duo .world-head h3,
  .worlds-duo .world-head p:not(.eyebrow) { grid-column: 1; grid-row: auto; align-self: auto; }
}

.cards { display: grid; gap: 20px; }
@media (min-width: 760px) {
  .cards-2 { grid-template-columns: 1fr 1fr; }
}

/* ---------- App card ---------- */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, var(--surface)) 0, var(--surface) 140px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  scroll-margin-top: 24px;
}
.app:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--c) 45%, var(--rule));
}
.app:target { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }

.cards > *, .worlds-duo > * { min-width: 0; }

.app-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
/* Phones: status pill drops under the name so the name gets the full width */
@media (max-width: 520px) {
  .app { padding: 20px; }
  .app-head { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; }
  .app-head > div { grid-row: 1 / span 2; grid-column: 2; }
  .app-icon { width: 56px; height: 56px; grid-row: 1 / span 2; }
  .status { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 6px; }
}
.app-icon {
  width: 64px; height: 64px;
  border-radius: 23%;
  box-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 6px 14px -8px rgb(0 0 0 / .45);
}
.app-name { font-size: 1.4rem; line-height: 1.1; font-weight: 740; letter-spacing: -0.02em; }
.app-tag { margin-top: 4px; font-size: .98rem; font-weight: 520; color: var(--ink-2); line-height: 1.3; }

.status {
  align-self: start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--live); }
.status-soon { color: var(--soon); }

.app-desc { color: var(--ink-2); text-wrap: pretty; }

.app-shot {
  border-radius: 14px;
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  background: var(--sunk);
}

/* Wall Candy's preview: its logo on its own candy-shop backdrop */
.wc-shot {
  position: relative;
  overflow: hidden;
  background-color: #fcf6e9;
  background-image:
    radial-gradient(circle at 8% 18%, #fbdad3 0 26px, transparent 27px),
    radial-gradient(circle at 22% 88%, #e2f0ec 0 34px, transparent 35px),
    radial-gradient(circle at 78% 12%, #e2f0ec 0 22px, transparent 23px),
    radial-gradient(circle at 93% 70%, #fbdad3 0 38px, transparent 39px),
    radial-gradient(circle at 62% 92%, #fff1c9 0 18px, transparent 19px),
    radial-gradient(circle at 40% 8%, #fff1c9 0 12px, transparent 13px);
}
.wc-shot img {
  position: absolute; inset: 0; margin: auto;
  height: 100%; width: auto;
  filter: drop-shadow(0 10px 14px rgb(57 33 50 / .18));
}

.platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.platforms li {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink-3);
  background: var(--surface);
}

.app-links {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--rule-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.go {
  font-weight: 680;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.go .arrow { transition: transform .2s ease; color: var(--c-text, var(--ink)); }
.app:hover .go .arrow { transform: translate(3px, -3px); }
.app:hover .go .arrow-in { transform: translateX(4px); }
.go:focus-visible { outline: none; }
.go:focus-visible::after { outline: 2.5px solid var(--table); outline-offset: 3px; }

.store {
  position: relative; z-index: 1;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  text-underline-offset: 3px;
}
.store:hover { color: var(--ink); }

/* ---------- About ---------- */

.about { background: var(--surface); border-block: 1px solid var(--rule); }
.about .wrap { display: grid; gap: 40px; }
@media (min-width: 920px) {
  .about .wrap { grid-template-columns: 1fr 1.5fr; gap: 72px; }
}
.about .section-head { margin-bottom: 0; }

.about-lede {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 560;
  text-wrap: pretty;
}
.about-body p + p { margin-top: 16px; }
.about-body > p:not(.about-lede) { color: var(--ink-2); margin-top: 20px; }

.principles {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}
@media (min-width: 640px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles li {
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
}
.principles h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.principles p { margin-top: 6px; font-size: .95rem; color: var(--ink-2); line-height: 1.45; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin: 36px 0 0;
  border-top: 1px solid var(--rule);
}
.facts div { padding: 16px 16px 0 0; }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 720; letter-spacing: -0.02em; line-height: 1.2; }
.facts dd small { display: block; font-size: .85rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-top: 2px; }

/* ---------- Contact ---------- */

.contact-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: 32px;
  padding: clamp(32px, 6vw, 64px);
  display: grid;
  gap: 28px;
  align-items: end;
}
@media (min-width: 860px) { .contact-card { grid-template-columns: 1.4fr auto; } }
.contact-card .eyebrow { color: color-mix(in srgb, var(--paper) 65%, var(--ink)); }
.contact-card h2 {
  margin-top: 12px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 740;
  text-wrap: balance;
}
.contact-card p { margin-top: 14px; color: color-mix(in srgb, var(--paper) 78%, var(--ink)); max-width: 52ch; }
.contact-card .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.contact-card .btn:hover { transform: translateY(-2px); }

/* ---------- Footer ---------- */

.site-footer { padding-block: 40px 56px; color: var(--ink-3); font-size: 14.5px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .app:hover { transform: none; }
}
