/* Harbor Workspace site (workspace.brandcode10.com). Colours come from tokens.css (the Waffle
   Whale brand tokens); never use raw hex here, except the two fixed mascot inks below, which
   stay the same in both themes. Same patterns as the studio site (wafflewhale/site). */

:root {
  --peek-ink: #15202B;
  --peek-light: #FFFFFF;
  --gutter: var(--space-4);
  --page: 1120px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 768px) {
  :root { --gutter: var(--space-5); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

img, svg { display: block; max-width: 100%; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--primary); color: var(--primary-foreground);
  padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; line-height: 20px; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

.container {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Type, following the brand scale */
.display { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.title { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.3px; margin: 0; }
.heading { font-size: 20px; line-height: 26px; font-weight: 700; margin: 0; }
.subheading { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; }
.body-sm { font-size: 14px; line-height: 20px; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; }
.muted { color: var(--muted-foreground); }
.fine { margin: var(--space-4) 0 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.center { text-align: center; }

@media (min-width: 768px) {
  .display { font-size: 44px; line-height: 52px; letter-spacing: -.8px; }
  .title { font-size: 32px; line-height: 38px; }
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
  backdrop-filter: saturate(1.4) blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 64px;
}
.brand-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 0;
  border-radius: var(--radius-xs); color: var(--foreground); text-decoration: none;
}
.brand-link img { width: 32px; height: 32px; border-radius: 22.37%; box-shadow: var(--shadow-sm); }
.brand-name { font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }

.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

.header-end { display: flex; align-items: center; gap: var(--space-4); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-full);
  color: var(--muted-foreground); text-decoration: none;
  font-size: 15px; line-height: 20px; font-weight: 600;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}
.site-nav a:hover { color: var(--foreground); background: var(--muted); }
.site-nav a[aria-current="page"] { color: var(--foreground); background: var(--secondary); }

/* Phone: nav drops to its own row under the logo */
@media (max-width: 759px) {
  .header-row { flex-wrap: wrap; row-gap: 0; }
  .header-end { display: contents; }
  .theme-toggle { order: 2; }
  .site-nav { order: 3; width: 100%; margin: 0 -12px; padding-bottom: 6px; }
  .site-nav ul { justify-content: space-between; }
}

/* Theme toggle: system / light / dark */
.theme-toggle {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--muted); border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.theme-toggle button {
  appearance: none; border: 0; margin: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: var(--radius-full);
  display: grid; place-items: center;
  background: transparent; color: var(--muted-foreground);
  transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.theme-toggle button:hover { color: var(--foreground); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm);
}
.theme-toggle svg { width: 16px; height: 16px; }
@media (pointer: coarse) {
  .theme-toggle button { position: relative; }
  .theme-toggle button::after { content: ""; position: absolute; inset: -5px -2px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius);
  font: 600 15px/20px var(--font-sans); text-decoration: none; border: 0; cursor: pointer;
  transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { text-decoration: none; filter: brightness(.98); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.center-row { justify-content: center; }

/* Sections */
main { display: block; }
.section { padding: var(--space-7) 0; }
@media (min-width: 768px) { .section { padding: 88px 0; } }
.section-head { max-width: 620px; margin-bottom: var(--space-6); }
.section-head p { margin: var(--space-2) 0 0; color: var(--muted-foreground); font-size: 17px; line-height: 26px; }
.band { background: var(--muted); }

/* Hero */
.hero { padding: var(--space-7) 0 var(--space-6); }
@media (min-width: 768px) { .hero { padding: 88px 0 72px; } }
.hero-grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.3fr 1fr; gap: var(--space-7); } }
.hero-icon {
  width: 72px; height: 72px; margin-bottom: var(--space-5);
  border-radius: 22.37%; box-shadow: var(--shadow-md);
}
@media (min-width: 768px) { .hero-icon { width: 88px; height: 88px; } }
.hero-copy .lede {
  margin: var(--space-4) 0 var(--space-6); max-width: 540px;
  font-size: 18px; line-height: 28px; color: var(--muted-foreground);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; margin-bottom: var(--space-4);
  background: var(--secondary); color: var(--secondary-foreground);
  border-radius: var(--radius-full); text-decoration: none;
  font-size: 14px; line-height: 20px; font-weight: 600;
}
a.eyebrow:hover { text-decoration: underline; }
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--accent);
  box-shadow: 0 0 0 2px var(--secondary);
}
.hero-copy .eyebrow { display: flex; width: max-content; max-width: 100%; }
.hero-art { display: flex; justify-content: center; }
.hero-art .peek { width: min(60vw, 260px); }
@media (min-width: 860px) { .hero-art .peek { width: 300px; } }

/* Peek the mascot: inline SVG bound to tokens so it re-colours in dark mode */
.peek svg { width: 100%; height: auto; overflow: visible; }
.peek .bgd { fill: var(--secondary); }
.peek .sh { fill: var(--foreground); opacity: .08; }
.peek .b { fill: var(--primary); }
.peek .bl { fill: var(--peek-light); opacity: .5; }
.peek .e { fill: var(--peek-ink); }
.peek .hl { fill: var(--peek-light); }
.peek .el { fill: none; stroke: var(--peek-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.peek .ml { fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; }
.peek .card { fill: var(--peek-light); stroke: var(--peek-ink); stroke-width: 1.6; }
.peek .gold { fill: var(--accent); stroke: var(--peek-ink); stroke-width: 1.4; }
.peek .goldr { fill: none; stroke: var(--peek-ink); stroke-width: 1; opacity: .5; }
.peek .gs { fill: none; stroke: var(--peek-light); stroke-width: 1.2; stroke-linecap: round; }
.peek .sparkle { fill: var(--accent); }
.peek .zz { fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.peek .bub { fill: none; stroke: var(--peek-ink); stroke-width: 1; }
.peek .cf1 { fill: var(--accent); }
.peek .cf2 { fill: var(--app-cursed-ink); }
.peek .cf3 { fill: var(--app-budget-ink); }

.peek .whale { transform-box: view-box; transform-origin: 32px 54px; }
.peek .fin { transform-box: view-box; transform-origin: 52px 43px; }

@media (prefers-reduced-motion: no-preference) {
  .peek-float .whale { animation: peek-float 5.5s ease-in-out infinite; }
  .peek-float .fin { animation: peek-wave 2.6s cubic-bezier(.34, 1.56, .64, 1) 600ms infinite; }
  .peek-float .waves { animation: peek-waves 2.6s ease-out 600ms infinite; }
  .peek-in { animation: peek-in 650ms cubic-bezier(.34, 1.56, .64, 1) both; }
}
@keyframes peek-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.6px); }
}
@keyframes peek-wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(6deg); }
  45% { transform: rotate(-6deg); }
}
@keyframes peek-waves {
  0%, 55%, 100% { opacity: .35; }
  15%, 40% { opacity: 1; }
}
@keyframes peek-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}

/* The three apps */
.app-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-4); grid-template-columns: 1fr;
}
@media (min-width: 860px) { .app-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); } }

.app-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.app-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.app-wash {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: var(--app-tint); color: var(--app-ink);
}
.app-wash img { width: 56px; height: 56px; flex: none; border-radius: 22.37%; box-shadow: var(--shadow-sm); }
.app-wash .heading { color: var(--app-ink); }
.app-body { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); flex: 1; }
.app-body p { margin: 0; color: var(--muted-foreground); }
.app-link {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; line-height: 20px; font-weight: 600;
  color: var(--primary); text-decoration: none;
}
.app-link svg { width: 16px; height: 16px; transition: transform 200ms var(--ease); }
.app-card:hover .app-link svg { transform: translate(2px, -2px); }
.app-card .app-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card .app-link:focus-visible { outline: none; }
.app-card:has(.app-link:focus-visible) { outline: 2px solid var(--ring); outline-offset: 3px; }

.tint-notes { --app-tint: var(--app-notes); --app-ink: var(--app-notes-ink); }
.tint-budget { --app-tint: var(--app-budget); --app-ink: var(--app-budget-ink); }
.tint-focus { --app-tint: var(--app-focus); --app-ink: var(--app-focus-ink); }
.tint-workspace { --app-tint: var(--app-workspace); --app-ink: var(--app-workspace-ink); }

/* Benefits */
.values { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
@media (min-width: 640px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .values { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); } }
.value-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: grid; place-items: center; margin-bottom: var(--space-4);
  background: var(--app-workspace); color: var(--app-workspace-ink);
}
.value-icon svg { width: 22px; height: 22px; }
.values p { margin: var(--space-2) 0 0; color: var(--muted-foreground); }

/* News teaser and the final call to action */
.news-card {
  display: grid; gap: var(--space-5); align-items: center;
  padding: var(--space-5); color: var(--foreground); text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.news-card p { margin: var(--space-2) 0 var(--space-3); }
.news-card .caption { margin: 0 0 var(--space-1); }
.news-card .peek { width: 112px; }
@media (min-width: 640px) {
  .news-card { grid-template-columns: auto 1fr; padding: var(--space-6); gap: var(--space-6); }
  .news-card .peek { width: 136px; }
}
.news-card:hover .app-link svg { transform: translateX(2px); }

.cta-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-7) var(--space-5);
  background: var(--app-workspace); color: var(--foreground);
  border-radius: var(--radius-xl);
}
.cta-card img { width: 64px; height: 64px; border-radius: 22.37%; box-shadow: var(--shadow-md); margin-bottom: var(--space-5); }
.cta-card .title { color: var(--app-workspace-ink); }
.cta-card p { margin: var(--space-2) 0 var(--space-5); max-width: 440px; color: var(--app-workspace-ink); }

/* Content pages */
.page-head { padding: var(--space-7) 0 var(--space-5); }
@media (min-width: 768px) { .page-head { padding: 72px 0 var(--space-6); } }
.page-head .lede { margin: var(--space-3) 0 0; max-width: 640px; font-size: 18px; line-height: 28px; color: var(--muted-foreground); }
.page-head.center .lede { margin-inline: auto; }
.page-head .btn-row { margin-top: var(--space-5); }
.page-icon { width: 72px; height: 72px; margin: 0 auto var(--space-5); border-radius: 22.37%; box-shadow: var(--shadow-md); }
.page-head-grid { display: grid; gap: var(--space-5); align-items: center; }
.page-head-grid .peek { width: 128px; }
.page-head-grid .caption { margin: 0 0 var(--space-2); }
@media (min-width: 768px) {
  .page-head-grid { grid-template-columns: 1fr auto; }
  .page-head-grid .peek { width: 168px; }
}

.prose { max-width: 720px; padding-bottom: var(--space-8); }
.page-head.center + .prose { margin-inline: auto; }
.stack { display: grid; gap: var(--space-4); }
.stack > .card {
  padding: var(--space-5);
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 140px;
}
.stack > .card > h2, .help-title h2 { font-size: 20px; line-height: 26px; font-weight: 700; margin: 0 0 var(--space-3); }
.prose p { margin: 0 0 var(--space-3); }
.prose p:last-child { margin-bottom: 0; }
.prose ul:not([class]) { margin: 0 0 var(--space-3); padding-left: 22px; }
.prose ul:not([class]) li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--muted-foreground); }

.help-title { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.help-title h2 { margin: 0; }
.help-title .icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; }
.help-title .icon svg { width: 20px; height: 20px; }
/* Help topic tints: Notes, Budget, Focus and the app itself */
.t-butter { background: var(--app-notes); color: var(--app-notes-ink); }
.t-mint { background: var(--app-budget); color: var(--app-budget-ink); }
.t-lav { background: var(--app-focus); color: var(--app-focus-ink); }
.t-sky { background: var(--app-workspace); color: var(--app-workspace-ink); }

.toc { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-5) 0 0; }
.toc a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-full); background: var(--muted); border: 1px solid var(--border);
  color: var(--foreground); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 500;
}
.toc a:hover { background: var(--secondary); color: var(--secondary-foreground); }

.kbd {
  font-weight: 600; white-space: nowrap;
  padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--muted); border: 1px solid var(--border);
}
.kbd.file { white-space: normal; word-break: break-all; }

.spec { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.spec dt { color: var(--muted-foreground); }
.spec dd { margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: var(--space-4); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); align-items: start; }
.steps li::before {
  content: counter(step); width: 32px; height: 32px; border-radius: var(--radius-full);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--secondary); color: var(--secondary-foreground);
}
.steps li > span { padding-top: 4px; }

.note {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); margin: 0;
  background: var(--secondary); color: var(--secondary-foreground);
  border-radius: var(--radius);
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.checks li { display: flex; gap: var(--space-3); align-items: flex-start; }
.checks svg {
  width: 24px; height: 24px; flex: none; padding: 4px; border-radius: var(--radius-full);
  background: var(--success); color: var(--success-foreground);
}

.list-card {
  list-style: none; padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.list-card li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-4); min-height: 60px; }
.list-row img { width: 36px; height: 36px; border-radius: 22.37%; flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow > span { display: block; }

/* Empty / error state (404) */
.empty {
  min-height: 60vh; display: grid; place-items: center; text-align: center;
  padding: var(--space-7) 0 var(--space-8);
}
.empty .peek { width: 160px; margin: 0 auto var(--space-5); }
.empty p { margin: var(--space-2) auto var(--space-5); max-width: 420px; color: var(--muted-foreground); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-7) 0 var(--space-6); }
.footer-grid { display: grid; gap: var(--space-6); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-logo { display: inline-block; border-radius: var(--radius-xs); }
.footer-brand img { height: 26px; width: auto; }
.footer-brand p { margin: var(--space-3) 0 0; max-width: 320px; color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.site-footer h2 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0 0 var(--space-3); color: var(--foreground); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer ul a {
  display: inline-flex; align-items: center; min-height: 32px;
  color: var(--muted-foreground); text-decoration: none; font-size: 14px; line-height: 20px;
}
.site-footer ul a:hover { color: var(--foreground); text-decoration: underline; }
.footer-base {
  margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); justify-content: space-between;
  color: var(--muted-foreground);
}
