@layer reset, base, layout, components, utilities;

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

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  figure,
  ol,
  dl,
  dd {
    margin: 0;
  }

  ol {
    padding: 0;
    list-style: none;
  }

  button,
  a {
    font: inherit;
  }
}

@layer base {
  :root {
    color-scheme: light;
    --green: #34a953;
    --green-hover: #2d9348;
    --green-deep: #0f3d24;
    --green-soft: #e8f7ed;
    --ink: #14211a;
    --ink-muted: #45584e;
    --ink-faint: #66786e;
    --canvas: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f6f8f7;
    --surface-strong: #edf2ef;
    --line: #e1e7e3;
    --line-strong: #cbd5cf;
    --header: rgb(255 255 255 / 0.9);
    --shadow: 0 24px 70px rgb(15 61 36 / 0.1);
    --radius: 16px;
    --header-height: 72px;
    --shell: 1180px;
    --focus: #176b31;
  }

  html[data-theme="dark"] {
    color-scheme: dark;
    --green: #54c873;
    --green-hover: #69d184;
    --green-deep: #bcecc9;
    --green-soft: #173420;
    --ink: #eef5f0;
    --ink-muted: #bdc9c1;
    --ink-faint: #96a89d;
    --canvas: #101713;
    --surface: #151f19;
    --surface-alt: #131b16;
    --surface-strong: #1d2a22;
    --line: #2b3a31;
    --line-strong: #405248;
    --header: rgb(16 23 19 / 0.9);
    --shadow: 0 24px 70px rgb(0 0 0 / 0.28);
    --focus: #7ddd96;
  }

  body {
    min-width: 320px;
    color: var(--ink);
    background: var(--canvas);
    font-family: Nunito, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
  }

  ::selection {
    color: #0f3d24;
    background: #bcecc9;
  }
}

@layer layout {
  .shell {
    width: min(calc(100% - 48px), var(--shell));
    margin-inline: auto;
  }

  .site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    height: var(--header-height);
    border-bottom: 1px solid var(--line);
    background: var(--header);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
    min-height: calc(100dvh - var(--header-height));
    padding-block: clamp(4.5rem, 9vh, 6rem);
  }

  .official-note__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
    align-items: center;
  }

  .promise {
    padding-block: clamp(5rem, 10vw, 8.5rem);
  }

  .promise__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    gap: clamp(3rem, 8vw, 7rem);
    align-items: start;
    margin-top: clamp(3rem, 7vw, 5.5rem);
  }

  .site-footer__inner {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 180px;
    padding-block: 3.5rem;
  }
}

@layer components {
  .sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .skip-link {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    color: #ffffff;
    background: #0f3d24;
    transform: translateY(-160%);
  }

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

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

  .brand__icon {
    display: block;
    width: 38px;
    height: auto;
    filter: drop-shadow(0 5px 8px rgb(15 61 36 / 0.16));
  }

  .brand__name {
    font-size: 1.25rem;
    font-weight: 850;
    letter-spacing: -0.03em;
  }

  .nav__actions {
    display: flex;
    gap: 1.25rem;
    align-items: center;
  }

  .nav__pilot {
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .theme-switch {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 750;
    transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
  }

  .theme-switch:hover {
    border-color: var(--green);
    background: var(--green-soft);
  }

  .theme-switch:active {
    transform: translateY(1px);
  }

  .theme-switch__icon {
    position: relative;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  }

  .eyebrow {
    width: max-content;
    margin-bottom: 1.35rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #a9dab7;
    border-radius: 10px;
    color: var(--green-deep);
    background: var(--green-soft);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .hero h1 {
    max-width: 720px;
    font-size: clamp(2.75rem, 5.1vw, 4.7rem);
    font-weight: 880;
    letter-spacing: -0.065em;
    line-height: 0.98;
  }

  .hero__title-line {
    display: block;
  }

  .hero__title-line--accent {
    color: var(--green);
  }

  .rotating-word {
    display: inline-grid;
    overflow: hidden;
    inline-size: 10ch;
    vertical-align: bottom;
    white-space: nowrap;
  }

  .rotating-word__text {
    grid-area: 1 / 1;
    will-change: transform, opacity, filter;
    transition:
      transform 240ms cubic-bezier(0.23, 1, 0.32, 1),
      opacity 180ms ease,
      filter 180ms ease;
  }

  .rotating-word__text.is-leaving {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(-35%);
  }

  .rotating-word__text.is-entering {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(35%);
    transition: none;
  }

  .hero__summary {
    max-width: 560px;
    margin-top: 1.7rem;
    color: var(--ink-muted);
    font-size: clamp(1.08rem, 1.6vw, 1.25rem);
    line-height: 1.55;
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 2rem;
    padding: 0.75rem 1.15rem;
    border: 1px solid #23763a;
    border-radius: 10px;
    color: #ffffff;
    background: #23763a;
    box-shadow: 0 12px 28px rgb(52 169 83 / 0.18);
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  }

  .button:hover {
    color: #ffffff;
    background: #1b5b2d;
    box-shadow: 0 16px 32px rgb(52 169 83 / 0.24);
    transform: translateY(-1px);
  }

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

  .information-path {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .information-path::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 38%;
    height: 6px;
    background: var(--green);
    content: "";
  }

  .information-path__top {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    justify-content: space-between;
  }

  .information-path__logo {
    display: block;
    flex: 0 0 auto;
    width: clamp(76px, 9vw, 96px);
    height: auto;
    margin-top: -0.4rem;
    filter: drop-shadow(0 14px 18px rgb(15 61 36 / 0.14));
  }

  .information-path__heading p {
    color: var(--ink-faint);
    font-size: 0.8rem;
    font-weight: 800;
  }

  .information-path__heading h2 {
    max-width: 410px;
    margin-top: 0.35rem;
    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
  }

  .path-list {
    position: relative;
    display: grid;
    gap: 0;
    margin-block: 2rem 1.6rem;
  }

  .path-list::before {
    position: absolute;
    z-index: 0;
    top: 30px;
    bottom: 30px;
    left: 25px;
    width: 2px;
    background: var(--line-strong);
    content: "";
  }

  .path-list__item {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding-block: 0.8rem;
  }

  .path-list__item--agora {
    margin-block: 0.35rem;
    padding: 1rem;
    border: 1px solid #a9dab7;
    border-radius: var(--radius);
    background: var(--green-soft);
  }

  .path-list__mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink-muted);
    background: var(--surface);
    font-weight: 900;
  }

  .path-list__item--agora .path-list__mark {
    border-color: #34a953;
    color: #ffffff;
    background: #23763a;
  }

  .path-list strong,
  .path-list small {
    display: block;
  }

  .path-list strong {
    font-size: 1rem;
  }

  .path-list small {
    margin-top: 0.1rem;
    color: var(--ink-muted);
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .information-path figcaption {
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 0.82rem;
  }

  .official-note {
    padding-block: clamp(2.4rem, 5vw, 3.5rem);
    border-block: 1px solid var(--line);
    background: var(--surface-alt);
  }

  .official-note__label {
    color: var(--green-deep);
    font-size: 0.82rem;
    font-weight: 850;
  }

  .official-note h2 {
    margin-top: 0.25rem;
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
  }

  .official-note p:last-child {
    max-width: 760px;
    margin-top: 0.65rem;
    color: var(--ink-muted);
  }

  .text-link {
    color: var(--green-deep);
    font-weight: 850;
    white-space: nowrap;
  }

  .text-link:hover {
    color: var(--green);
  }

  .promise__heading {
    max-width: 720px;
  }

  .promise__heading h2 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: -0.055em;
    line-height: 1;
  }

  .promise__heading p {
    max-width: 640px;
    margin-top: 1.3rem;
    color: var(--ink-muted);
    font-size: 1.15rem;
  }

  .promise-list {
    display: grid;
    gap: 2.4rem;
  }

  .promise-item {
    display: grid;
    grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line-strong);
  }

  .promise-item h3 {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .promise-item p {
    color: var(--ink-muted);
  }

  .principles {
    padding: 1.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
  }

  .principles h3 {
    max-width: 250px;
    font-size: 1.35rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
  }

  .principles dl {
    display: grid;
    gap: 1.35rem;
    margin-top: 2rem;
  }

  .principles dl div {
    padding-top: 1.1rem;
    border-top: 1px solid var(--line-strong);
  }

  .principles dt {
    color: var(--green-deep);
    font-weight: 850;
  }

  .principles dd {
    margin-top: 0.3rem;
    color: var(--ink-muted);
    font-size: 0.92rem;
  }

  .site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface-alt);
  }

  .site-footer p {
    color: var(--ink-muted);
  }

  .site-footer__brand {
    color: var(--ink) !important;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.035em;
  }

  .site-footer__note {
    font-size: 0.9rem;
  }
}

@layer utilities {
  @media (max-width: 860px) {
    .shell {
      width: min(calc(100% - 32px), var(--shell));
    }

    .hero {
      grid-template-columns: minmax(0, 1fr);
      gap: 3rem;
      min-height: auto;
      padding-block: 4.5rem;
    }

    .hero h1 {
      max-width: 680px;
    }

    .information-path {
      max-width: 640px;
    }

    .promise__layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .principles {
      max-width: 540px;
    }
  }

  @media (max-width: 640px) {
    :root {
      --header-height: 64px;
    }

    .nav__pilot {
      display: none;
    }

    .theme-switch span:last-child {
      position: absolute;
      overflow: hidden;
      width: 1px;
      height: 1px;
      clip: rect(0 0 0 0);
      white-space: nowrap;
      clip-path: inset(50%);
    }

    .theme-switch {
      width: 40px;
      padding: 0;
      justify-content: center;
    }

    .hero {
      gap: 2.5rem;
      padding-block: 3.5rem 4rem;
    }

    .hero h1 {
      font-size: clamp(2.45rem, 12vw, 3.5rem);
      line-height: 1;
    }

    .hero__title-line {
      display: inline;
    }

    .button {
      width: 100%;
    }

    .information-path {
      padding: 1.25rem;
    }

    .information-path__logo {
      width: 72px;
    }

    .path-list__item {
      grid-template-columns: 46px minmax(0, 1fr);
      gap: 0.75rem;
    }

    .path-list__mark {
      width: 46px;
      height: 46px;
    }

    .path-list::before {
      left: 22px;
    }

    .path-list__item--agora {
      margin-inline: -0.25rem;
      padding: 0.85rem;
    }

    .official-note__inner {
      grid-template-columns: minmax(0, 1fr);
      gap: 1.4rem;
    }

    .promise {
      padding-block: 4.5rem;
    }

    .promise__layout {
      gap: 3.5rem;
    }

    .promise-item {
      grid-template-columns: minmax(0, 1fr);
      gap: 0.7rem;
    }

    .site-footer__inner {
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }

    .rotating-word__text {
      opacity: 1 !important;
      filter: none !important;
      transform: none !important;
    }
  }

  @media (prefers-reduced-transparency: reduce) {
    .site-header {
      background: var(--canvas);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
  }

  @media (forced-colors: active) {
    .brand__icon,
    .path-list__item--agora .path-list__mark {
      border: 2px solid ButtonText;
    }
  }
}
