/*
  Tommeren – the front door to our home apps.

  Colour tokens are copied by hand from husbudget's src/app/globals.css (@theme block),
  see design-system/husbudget/MASTER.md in that repo. Every colour is a light-dark() pair,
  so a token has one name and two values and the page follows the OS scheme.
*/

:root {
  color-scheme: light dark;

  /* Surfaces */
  --paper: light-dark(#f4efe6, #141917);
  --card: light-dark(#fbf8f2, #1b2120);
  --wash: light-dark(#e6eae3, #242c29);
  --line: light-dark(#d8d1c3, #2f3834);

  /* Text */
  --ink: light-dark(#1c2321, #ece6da);
  --muted: light-dark(#5f6b66, #9ea9a2);

  /* Accent – dusty sage */
  --sage: light-dark(#4f6b5b, #9fbba9);
  --sage-deep: light-dark(#41594b, #b6cebf);
  --sage-soft: light-dark(#e3eae2, #22302a);
  --on-sage: light-dark(#fbf8f2, #141917);

  --hairline: 1px;
}

/* True hairlines on 2x screens (iPhone, Retina). */
@media (min-resolution: 2dppx) {
  :root {
    --hairline: 0.5px;
  }
}

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

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 4rem 1rem calc(3rem + env(safe-area-inset-bottom));
}

.wordmark {
  margin: 0 0 2.5rem;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-height: 88px;
  padding: 1.25rem;
  border: var(--hairline) solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 100ms ease;
}

.tile-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 0.5rem;
  color: var(--sage);
}

.tile-label {
  font-weight: 500;
  font-size: 1.0625rem;
}

.tile-description {
  color: var(--muted);
  font-size: 0.875rem;
}

.tile:hover {
  background: var(--sage-soft);
  border-color: var(--sage-soft);
}

.tile:active {
  background: var(--sage-soft);
  border-color: var(--sage-soft);
  transform: scale(0.98);
}

.tile:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .page {
    max-width: 40rem;
    padding: 5rem 1.5rem 4rem;
  }

  .wordmark {
    margin-bottom: 3rem;
    font-size: 2.5rem;
  }

  .tiles {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  .tile:active {
    transform: none;
  }
}
