/* ===== Tokens ===== */
:root {
  --bg: #0d0d0f;
  --surface: #17171b;
  --surface-2: #202026;
  --border: #2c2c34;
  --text: #f2f2f4;
  --muted: #a3a3ad;
  --accent: #ff7a1a;
  --accent-2: #ffb547;
  --success: #3ccf7a;
  --danger: #ff5d5d;
  --radius: 16px;
  --max: 1100px;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--accent-2);
}

ul {
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
}

code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.95em;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--accent);
  color: #111;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 2000;
}

.skip-link:focus {
  top: 12px;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.logo img {
  width: 150px;
  mix-blend-mode: lighten; /* hides the PNG's black background on the dark navbar */
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Layout ===== */
main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px);
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 8px 0 32px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #141414;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-small:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled {
  cursor: default;
  color: var(--success);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 10% 15% auto;
  height: 260px;
  background: radial-gradient(closest-side, rgba(255, 122, 26, 0.25), transparent);
  z-index: -1;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.8rem);
  margin: 12px auto 16px;
  max-width: 800px;
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto 28px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.hero-badges li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--muted);
}

/* ===== Tracker ===== */
.tracker-section {
  max-width: 760px !important;
}

.habit-form {
  display: flex;
  gap: 10px;
}

.habit-form input,
.contact-form input,
.contact-form textarea {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.habit-form input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.form-error {
  color: var(--danger);
  min-height: 1.4em;
  margin-top: 6px;
  font-size: 0.92rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.3s;
}

.habit-list {
  display: grid;
  gap: 10px;
}

.habit {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.habit.is-done {
  border-color: rgba(60, 207, 122, 0.5);
}

.check {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: #0d0d0f;
  font-weight: 800;
  cursor: pointer;
}

.check:hover {
  border-color: var(--success);
}

.habit.is-done .check {
  background: var(--success);
  border-color: var(--success);
}

.habit-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.habit-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.habit.is-done .habit-name {
  text-decoration: line-through;
  color: var(--muted);
}

.habit-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.week {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.dot.on {
  background: var(--success);
  border-color: var(--success);
}

.delete {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.delete:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ===== Challenges ===== */
.challenge-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}

.challenge-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.challenge-card h3 {
  color: var(--accent-2);
  font-size: 1.1rem;
}

.challenge-card p {
  color: var(--muted);
  flex: 1;
}

.challenge-card .btn {
  align-self: flex-start;
}

/* ===== About ===== */
.about-container {
  max-width: 720px;
  margin: 24px auto 0;
  display: grid;
  gap: 14px;
  color: var(--muted);
  font-size: 1.08rem;
}

/* ===== Contact ===== */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.92rem;
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
  margin-bottom: 8px;
}

.form-note {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ===== Footer ===== */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 24px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 120%);
  max-width: calc(100% - 32px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 12px 20px;
  border-radius: 12px;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  z-index: 1500;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
