:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --panel: #fffdf9;
  --text: #1f1e1b;
  --text-soft: #4b4740;
  --muted: #726d63;
  --line: #e5e0d6;
  --line-strong: #cfc8bb;
  --accent: #2e6b5c;
  --accent-soft: #e7efea;
  --navy: #0d3b66;
  --orange: #f95738;
  --orange-soft: #fdeee9;
  --shadow: 0 1px 0 rgba(31, 30, 27, 0.04), 0 16px 40px rgba(31, 30, 27, 0.07);
  --shadow-lift: 0 30px 64px rgba(31, 30, 27, 0.14);
  --pad: clamp(16px, 3vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141311;
    --panel: #1b1916;
    --text: #ece8df;
    --text-soft: #c9c2b5;
    --muted: #9b9487;
    --line: #2a2722;
    --line-strong: #3a352d;
    --accent: #7fb8a5;
    --accent-soft: #1e2a24;
    --navy: #8db4dd;
    --orange: #ff8a6e;
    --orange-soft: #33211d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 18px 44px rgba(0, 0, 0, 0.36);
    --shadow-lift: 0 32px 72px rgba(0, 0, 0, 0.52);
  }
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(46, 107, 92, 0.1), transparent 62%),
    radial-gradient(900px 540px at -12% 18%, rgba(249, 87, 56, 0.07), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(1100px 620px at 82% -8%, rgba(127, 184, 165, 0.09), transparent 62%),
      radial-gradient(900px 540px at -12% 18%, rgba(255, 138, 110, 0.06), transparent 62%),
      var(--bg);
  }
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 10px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.screen {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 1.8vh, 20px);
  padding: clamp(14px, 2.4vh, 26px) var(--pad) clamp(16px, 2.6vh, 30px);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  min-height: 38px;
  width: min(100%, 1320px);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 12px rgba(46, 107, 92, 0.24));
  transition: transform 0.2s ease;
}

.brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-2deg);
}

.brand-name {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* Stage */

.stage {
  min-height: 0;
}

.stage-grid {
  height: 100%;
  width: min(100%, 1320px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(300px, 1.45fr) minmax(190px, 0.9fr);
  align-items: center;
  gap: clamp(18px, 2.8vw, 46px);
}

/* Section buttons */

.section-tile {
  --ink: var(--accent);
  --tint: #e8f0ea;
  --cta: #245548;
  --hover-line: #b7d2c5;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  height: clamp(180px, 34vh, 360px);
  max-height: 100%;
  padding: clamp(12px, 2.2vh, 24px);
  border: 1px solid var(--line);
  border-radius: clamp(20px, 2.2vw, 30px);
  background:
    radial-gradient(140% 90% at 86% 0%, var(--tint), transparent 64%),
    var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.section-tile--files {
  --ink: var(--navy);
  --tint: #e8edf4;
  --cta: #0d3b66;
  --hover-line: #b7c9db;
}

@media (prefers-color-scheme: dark) {
  .section-tile--tasks {
    --tint: #1d2a24;
    --hover-line: #3d5a4e;
    --ink: #8fcdb7;
    --cta: #2f6b58;
  }

  .section-tile--files {
    --tint: #1a2531;
    --hover-line: #35516e;
    --ink: #8db4dd;
    --cta: #1b4a78;
  }
}

.section-tile::after {
  content: "";
  position: absolute;
  top: -140px;
  right: -110px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: var(--tint);
  opacity: 0.6;
  pointer-events: none;
}

.section-tile--files::before {
  content: "";
  position: absolute;
  bottom: -120px;
  left: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--orange-soft);
  opacity: 0.55;
  pointer-events: none;
}

.section-tile > * {
  position: relative;
  z-index: 1;
}

.section-tile:hover {
  transform: translateY(-4px);
  border-color: var(--hover-line);
  box-shadow: var(--shadow-lift);
}

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

.tile-art {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.tile-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.section-tile:hover .tile-art img {
  transform: scale(1.035);
}

.tile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: clamp(22px, 3.4vh, 36px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.tile-title svg {
  flex: 0 0 auto;
  width: clamp(20px, 2.4vh, 27px);
  height: auto;
  color: var(--ink);
  transition: transform 0.22s ease;
}

.section-tile:hover .tile-title svg {
  transform: translateX(4px);
}

/* Center illustration */

.hero-art {
  position: relative;
  align-self: stretch;
  min-height: 0;
  height: 100%;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 6% 2% 2% 2%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(46, 107, 92, 0.15), transparent 72%),
    radial-gradient(closest-side at 68% 62%, rgba(249, 87, 56, 0.08), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 44px rgba(31, 30, 27, 0.14));
}

@media (prefers-color-scheme: dark) {
  .hero-art img {
    filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.5));
  }
}

/* Responsive */

@media (max-width: 900px) {
  .stage {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .stage-grid {
    height: auto;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    gap: clamp(10px, 1.8vh, 18px);
  }

  .hero-art {
    grid-column: 1 / -1;
    grid-row: 1;
    height: clamp(150px, 44vh, 480px);
  }

  .section-tile--tasks {
    grid-column: 1;
    grid-row: 2;
  }

  .section-tile--files {
    grid-column: 2;
    grid-row: 2;
  }

  .section-tile {
    height: clamp(110px, 20vh, 190px);
    padding: clamp(9px, 1.6vh, 16px);
    border-radius: clamp(16px, 2vw, 22px);
  }

  .tile-title {
    font-size: clamp(17px, 2.8vh, 24px);
  }

  .tile-title svg {
    width: clamp(16px, 2.1vh, 21px);
  }
}

@media (max-width: 560px) {
  .screen {
    gap: 8px;
    padding: 14px 14px 16px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .stage-grid {
    gap: 10px;
  }

  .hero-art {
    height: clamp(170px, 42vh, 380px);
  }

  .section-tile {
    height: clamp(112px, 19vh, 160px);
    border-radius: 18px;
  }

  .tile-title {
    gap: 6px;
    font-size: clamp(17px, 2.6vh, 21px);
  }
}

@media (max-height: 560px) and (min-width: 901px) {
  .section-tile {
    height: clamp(150px, 38vh, 260px);
  }

  .tile-title {
    font-size: clamp(20px, 3vh, 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Header actions */

.header-spacer {
  flex: 1;
}

.header-link,
.logout-form .header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.header-link:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--accent-soft);
}

.header-link .icon {
  width: 16px;
  height: 16px;
}

.logout-form {
  margin: 0;
}

@media (max-width: 560px) {
  .header-link {
    padding: 7px 11px;
  }
}
