/* ============================================================
   Aman Iman — base.css
   Design tokens + reset. Loaded before style.css.
   ============================================================ */

:root {
  /* ---- Type scale (fluid) ---- */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.4rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.75rem);

  /* ---- Spacing (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- Radius ---- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Content widths ---- */
  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1240px;

  /* ---- Fonts ---- */
  --font-display: "Zodiak", "Cormorant Garamond", Georgia, serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

/* ============================================================
   COLOR — deep water + clear aqua + warm shore neutrals
   ============================================================ */
:root,
[data-theme="light"] {
  --color-bg: #f3fbfc;          /* clear shallow water */
  --color-surface: #ffffff;
  --color-surface-2: #f8fdfe;
  --color-surface-offset: #e4f5f8;
  --color-divider: #c9e2e9;
  --color-border: #b8d8e2;

  --color-text: #173139;        /* deep water ink */
  --color-text-muted: #526b73;
  --color-text-faint: #8aa0a7;
  --color-text-inverse: #f7fcfd;

  --color-primary: #007f9a;     /* clear water blue */
  --color-primary-hover: #00677d;
  --color-primary-active: #004d61;
  --color-primary-soft: #def3f7;

  --color-accent: #007187;      /* accessible aqua on light surfaces */
  --color-accent-hover: #00596d;
  --color-accent-on-deep: #00677d;
  --color-accent-soft: #cdebf0;

  --color-deep: #dff4f8;        /* translucent water surface */
  --color-deep-text: #173139;

  --shadow-sm: 0 1px 3px rgba(23, 49, 57, 0.07);
  --shadow-md: 0 6px 20px rgba(23, 49, 57, 0.10);
  --shadow-lg: 0 18px 48px rgba(6, 43, 58, 0.18);

  --pattern-ink: rgba(0, 127, 154, 0.09);
}

[data-theme="dark"] {
  --color-bg: #071218;
  --color-surface: #0b1a21;
  --color-surface-2: #10232c;
  --color-surface-offset: #132c36;
  --color-divider: #24404a;
  --color-border: #31515c;

  --color-text: #e9f6f8;
  --color-text-muted: #a9c1c8;
  --color-text-faint: #6f8992;
  --color-text-inverse: #04141b;

  --color-primary: #78d6e5;
  --color-primary-hover: #9ae5ef;
  --color-primary-active: #b7f0f6;
  --color-primary-soft: #12343e;

  --color-accent: #a9ecf2;
  --color-accent-hover: #c5f5f8;
  --color-accent-on-deep: #a9ecf2;
  --color-accent-soft: #12343e;

  --color-deep: #05273f;
  --color-deep-text: #f7fcfd;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);

  --pattern-ink: rgba(154, 229, 239, 0.12);
}

/* System preference fallback when no manual toggle has run */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #071218;
    --color-surface: #0b1a21;
    --color-surface-2: #10232c;
    --color-surface-offset: #132c36;
    --color-divider: #24404a;
    --color-border: #31515c;
    --color-text: #e9f6f8;
    --color-text-muted: #a9c1c8;
    --color-text-faint: #6f8992;
    --color-text-inverse: #04141b;
    --color-primary: #78d6e5;
    --color-primary-hover: #9ae5ef;
    --color-primary-active: #b7f0f6;
    --color-primary-soft: #12343e;
    --color-accent: #a9ecf2;
    --color-accent-hover: #c5f5f8;
    --color-accent-on-deep: #a9ecf2;
    --color-accent-soft: #12343e;
    --color-deep: #05273f;
    --color-deep-text: #f7fcfd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --pattern-ink: rgba(154, 229, 239, 0.12);
  }
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.15;
  font-weight: 500;
}

p,
li {
  text-wrap: pretty;
  max-width: 68ch;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

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

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a,
button,
[role="button"] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

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

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