/* CDI IELTS Simulator — Design System */
/* Minimalist, high-contrast, brutalist + creative */

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #0a0a0a;
  --color-text-muted: #525252;
  --color-accent: #0a0a0a;
  --color-border: #0a0a0a;
  --color-cta-bg: #0a0a0a;
  --color-cta-text: #fafafa;
  --color-highlight-bg: #0a0a0a;
  --color-highlight-text: #fafafa;
}

[data-theme='dark'] {
  --color-bg: #0a0a0a;
  --color-surface: #171717;
  --color-text: #fafafa;
  --color-text-muted: #a3a3a3;
  --color-accent: #fafafa;
  --color-border: #404040;
  --color-cta-bg: #fafafa;
  --color-cta-text: #0a0a0a;
  --color-highlight-bg: #fafafa;
  --color-highlight-text: #0a0a0a;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* --- Background layers --- */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 4rem 4rem;
  opacity: 0.08;
}

.corner-bracket {
  position: fixed;
  width: clamp(4rem, 15vw, 10rem);
  height: clamp(4rem, 15vw, 10rem);
  border-color: var(--color-border);
  border-style: solid;
  border-width: 0;
  opacity: 0.4;
  z-index: 0;
}

.corner-tl {
  top: 1.5rem;
  left: 1.5rem;
  border-top-width: 3px;
  border-left-width: 3px;
}

.corner-br {
  bottom: 1.5rem;
  right: 1.5rem;
  border-bottom-width: 3px;
  border-right-width: 3px;
}

/* --- Landing --- */
.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.landing-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-mark {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  text-decoration: none;
}

.logo-mark:hover {
  color: var(--color-text);
}

.theme-toggle {
  position: relative;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-size: 1.25rem;
}

.theme-toggle:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.98);
}

.theme-icon {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-icon.moon {
  display: none;
}

[data-theme='dark'] .theme-icon.sun {
  display: none;
}

[data-theme='dark'] .theme-icon.moon {
  display: inline;
}

/* --- Hero --- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.hero-badge {
  margin: 0 0 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 11vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.9;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.06em;
}

.hero-line {
  display: inline-block;
  animation: fadeUp 0.6s ease both;
}

.hero-line:nth-child(1) { animation-delay: 0.05s; }
.hero-line:nth-child(2) { animation-delay: 0.1s; }
.hero-line:nth-child(3) { animation-delay: 0.15s; }
.hero-line:nth-child(4) { animation-delay: 0.2s; }

.hero-line-accent {
  position: relative;
  display: inline-block;
  padding: 0.1em 0.2em 0.06em;
  background: var(--color-highlight-bg);
  color: var(--color-highlight-text);
  letter-spacing: -0.02em;
}

.hero-line-accent::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-highlight-text);
  opacity: 0.4;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
}

.hero-title:hover .hero-line-accent::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --- All Tests --- */
.all-tests {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.all-tests-title {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 48rem;
}

.test-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.2s ease, transform 0.2s ease, gap 0.2s ease;
  position: relative;
}

.test-card:hover {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
  transform: translateY(-2px);
}

.test-card-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0.5;
}

.test-card:hover .test-card-number {
  opacity: 0.7;
}

.test-card-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.test-card-meta {
  font-size: 0.8125rem;
  opacity: 0.6;
}

.test-card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.test-card:hover .test-card-arrow {
  transform: translateX(4px);
}

.hero-band {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.hero-band.hidden {
  display: none;
}

.hero-subtext {
  margin: 1.5rem 0 2.5rem;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  color: var(--color-text-muted);
  animation: fadeUp 0.6s ease 0.25s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--color-border);
  transition: background 0.2s ease, color 0.2s ease, gap 0.2s ease, transform 0.2s ease;
  animation: fadeUp 0.6s ease 0.35s both;
}

.hero-cta:hover {
  background: var(--color-cta-text);
  color: var(--color-cta-bg);
  gap: 1rem;
  transform: translateY(-2px);
}

.hero-cta:active {
  transform: translateY(0);
}

.hero-cta-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.hero-cta:hover .hero-cta-arrow {
  transform: translateX(4px);
}

/* --- Footer --- */
.landing-footer {
  padding: 1.5rem 2rem;
  border-top: 2px solid var(--color-border);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-dash {
  font-weight: 700;
}

/* --- Motion --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-badge,
  .hero-line,
  .hero-subtext,
  .hero-cta {
    animation: none;
  }
  .hero-line-accent::after {
    transition: none;
  }
}
