/* WidgetApp page. Same look as the CV site (tdeboer.com): one web font
   (Archivo, for headings), system fonts for the rest, one blue accent.
   The home screen in the hero uses the widgets' own default colours. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Widget theme 1 from MazeRenderer / PlinkoRenderer. */
  --w-bg: #10141F;
  --w-ink: #DCE3F2;
  --w-pin: #8C96AD;
  --w-path: #4FC3F7;
  --w-ball: #FFC857;
  --w-plus: #66BB6A;
  --w-minus: #EF5350;
}

.t-dark {
  color-scheme: dark;
  --bg: #151515; --surface: #1d1d1d; --line: #2c2c2c; --line-strong: #5c5c5c;
  --ink: #ececea; --muted: #a3a3a0;
  --primary: #8aa8ff; --on-primary: #10131c; --psoft: #1c2235; --on-psoft: #b3c6ff;
}
.t-light {
  color-scheme: light;
  --bg: #faf9f6; --surface: #ffffff; --line: #e3e1dc; --line-strong: #8a8884;
  --ink: #1b1b1b; --muted: #5a5955;
  --primary: #2348c4; --on-primary: #ffffff; --psoft: #e8edfb; --on-psoft: #1d3aa0;
}

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

html {
  scroll-behavior: smooth;
  accent-color: var(--primary);
  -webkit-tap-highlight-color: transparent; /* replaced by the :active states below */
}

::selection { background: var(--primary); color: var(--on-primary); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  transition: background 0.2s, color 0.2s;
}

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.skip-link {
  position: absolute;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--on-primary); }
main:focus { outline: none; }

h1, h2, h3, p { margin: 0; }

h1 {
  font: 700 clamp(40px, 9vw, 64px)/1.05 var(--font-display);
  letter-spacing: -0.025em;
}
h2 {
  font: 700 clamp(28px, 6vw, 36px)/1.15 var(--font-display);
  letter-spacing: -0.015em;
}

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.label { font-size: 14px; line-height: 20px; color: var(--muted); }
.lead { font-size: 19px; line-height: 1.55; color: var(--muted); }
.small { font-size: 15px; line-height: 22px; color: var(--muted); }
.title { font: 600 19px/26px var(--font-display); }

.tag {
  font: 500 13px/22px var(--font-body);
  background: var(--psoft);
  color: var(--on-psoft);
  border-radius: 3px;
  padding: 1px 7px;
  white-space: nowrap;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.btn svg { flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); filter: brightness(1.1); }
.btn-outline { border: 1px solid var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }

/* ------------------------------------------------------------------ nav */

.site-header { border-bottom: 1px solid var(--line); }
.nav {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 19px/28px var(--font-display);
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.nav-right { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.nav-links { display: flex; flex-wrap: wrap; gap: 2px; font-size: 15px; }
.nav-links a { padding: 10px 10px; text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }

.theme-toggle {
  min-height: 44px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.toggle-track {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.2s;
}
.t-dark .toggle-knob { transform: translateX(18px); }

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

.hero {
  padding-top: 72px;
  padding-bottom: 88px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: center;
}
.hero-main { flex: 1 1 400px; min-width: 0; max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.hero .lead { color: var(--ink); }
#release-info { min-height: 20px; }

.hero-widget {
  flex: 1 1 420px;
  max-width: 560px;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* -------------------------------------------------------------- widgets */
/* A widget looks like it does on a phone: a rounded tile in the widget's
   own colours, whatever the page theme. Sizes follow the launcher grid,
   so a 3×3 maze really is bigger than a 2×2 image. */

.widget {
  --cell: min(84px, (100vw - 32px - 24px) / 4);
  position: relative;
  display: block;
  overflow: hidden;
  width: calc(var(--w) * var(--cell) + (var(--w) - 1) * 8px);
  height: calc(var(--h) * var(--cell) + (var(--h) - 1) * 8px);
  border-radius: 22px;
  background: var(--w-bg);
  color: var(--w-ink);
}
.t-light .widget { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.widget canvas, .widget img { display: block; width: 100%; height: 100%; }
.widget img { object-fit: cover; }
button.widget { padding: 0; border: none; font: inherit; cursor: pointer; }

.w-plinko { width: 100%; height: auto; aspect-ratio: 4 / 3; padding: 8px; }

.w-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: url("quote-background.png") center / cover;
}
.w-quote p {
  max-width: 330px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.19); /* black_opacity50 in colors.xml */
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  text-align: center;
}

/* The maze image is fitCenter in the space above the buttons, as in widget_maze.xml. */
.w-maze { display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 8px 8px 0; }
.w-maze canvas { height: 100%; width: auto; max-width: 100%; aspect-ratio: 1; justify-self: center; }
.maze-buttons { display: flex; }
.maze-buttons button {
  flex: 1 1 0;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--w-ink);
  font: 500 14px/20px var(--font-body);
  cursor: pointer;
}
.maze-buttons button:hover { background: rgba(255, 255, 255, 0.06); }

/* ------------------------------------------------------------- showcase */

.section { padding-top: 80px; padding-bottom: 80px; border-top: 1px solid var(--line); }
.section > h2 { margin-bottom: 40px; }

.showcase { display: flex; flex-direction: column; }
.item {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px 48px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.item:first-child { border-top: none; padding-top: 0; }
.item-text { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.item-text-wide { grid-column: 1 / -1; max-width: 680px; }
.item-text .title { display: flex; align-items: center; gap: 10px; }
.item-text p:not(.small) { color: var(--ink); }

.rules { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 16px; line-height: 24px; }

/* -------------------------------------------------------------- install */

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px 80px; align-items: start; }
.install, .changes { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li::marker { font-weight: 700; color: var(--muted); }

.changes h2 { font-size: clamp(24px, 5vw, 28px); }
#changes-body h3 { font: 600 17px/24px var(--font-body); margin: 4px 0 0; }
#changes-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
#changes-body ul ul { margin-top: 6px; }
#changes-body strong { color: var(--ink); font-weight: 600; }
#changes-body > * + * { margin-top: 10px; }

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

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { padding-top: 32px; padding-bottom: 40px; }

/* Tap feedback, in place of the default iOS highlight. */
.btn:active, .theme-toggle:active, button.widget:active, .maze-buttons button:active { opacity: 0.75; }
.nav-links a:active, .brand:active { color: var(--ink); opacity: 0.75; }

@media (max-width: 760px) {
  .item { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 44px; padding-bottom: 56px; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .widget { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, .toggle-knob { transition: none; }
}
