@layer reset, base, components, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
  }

  img,
  svg {
    display: block;
    max-width: 100%;
  }

  button,
  input,
  textarea {
    font: inherit;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

@layer base {
  :root {
    --bg: #0b0f14;
    --panel: #0f1620;
    --text: #e9eef6;
    --muted: #a9b4c2;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #7c5cff;
    --accent-2: #2ee59d;
    --danger: #ff4d4d;
    --radius: 16px;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --container: 1120px;
  }

  body {
    background: radial-gradient(1100px 520px at 20% -10%, rgba(124, 92, 255, 0.28), transparent 55%),
      radial-gradient(900px 500px at 90% 0%, rgba(46, 229, 157, 0.16), transparent 60%),
      var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
      "Segoe UI Emoji";
    line-height: 1.55;
  }

  .container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
  }

  .section {
    padding: 88px 0;
    border-top: 1px solid var(--line);
  }

  .section:first-of-type {
    border-top: 0;
  }

  .kicker {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
  }

  h1,
  h2,
  h3 {
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
  }

  h1 {
    font-size: clamp(34px, 4.4vw, 56px);
  }

  h2 {
    font-size: clamp(26px, 3.2vw, 38px);
  }

  p {
    margin: 0 0 16px;
    color: var(--muted);
    max-width: 72ch;
  }
}

@layer components {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 15, 20, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }

  .topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
  }

  .topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  .brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 6px rgba(124, 92, 255, 0.14);
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 14px;
  }

  .nav a:hover {
    color: var(--text);
  }

  .socials {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .socials__link {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(233, 238, 246, 0.86);
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  }

  .socials__link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .socials__icon {
    width: 14px;
    height: 14px;
    display: block;
  }

  .socials__icon--fb {
    transform: translateX(0.25px) scale(0.92);
  }

  .hero {
    padding: 70px 0 88px;
  }

  .hero__grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
  }

  .hero__lead {
    font-size: 18px;
    color: var(--muted);
    margin: 0 0 24px;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 600;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  }

  .btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .btn--primary {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.96), rgba(46, 229, 157, 0.86));
    border-color: rgba(255, 255, 255, 0.12);
    color: #0a0d12;
  }

  .btn--ghost {
    background: transparent;
  }

  .btn--danger {
    border-color: rgba(255, 77, 77, 0.25);
    color: #ffd0d0;
  }

  .panel {
    background: rgba(15, 22, 32, 0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .media {
    overflow: hidden;
    border-radius: var(--radius);
  }

  .media img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
  }

  .author__photo img {
    max-height: 360px;
    object-fit: cover;
    border-radius: 999px;
  }

  .placeholder {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 18px;
    color: rgba(233, 238, 246, 0.7);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
  }

  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
  }

  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
  }

  .card h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .tools {
    display: grid;
    gap: 12px;
    margin-top: 18px;
  }

  .tool {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
  }

  .tool__media {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    place-items: center;
    color: rgba(233, 238, 246, 0.8);
    font-weight: 750;
    letter-spacing: 0.06em;
    font-size: 12px;
  }

  .tool__thumb-btn {
    border: 0;
    background: transparent;
    padding: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }

  .tool__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .tool__preview {
    margin-top: 10px;
  }

  .tool__preview summary {
    cursor: pointer;
    color: rgba(233, 238, 246, 0.86);
    font-size: 14px;
  }

  .tool__preview audio,
  .tool__preview video {
    width: 100%;
    margin-top: 10px;
  }

  .tool__title {
    font-weight: 650;
    margin: 0 0 6px;
    color: var(--text);
  }

  .tool__desc {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
  }

  .footer {
    padding: 34px 0 60px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
  }

  .form {
    display: grid;
    gap: 12px;
  }

  .field {
    display: grid;
    gap: 6px;
  }

  .field label {
    font-size: 13px;
    color: var(--muted);
  }

  .field input,
  .field textarea {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    outline: none;
  }

  .field textarea {
    min-height: 96px;
    resize: vertical;
  }

  .notice {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(233, 238, 246, 0.86);
    font-size: 14px;
  }

  .notice--error {
    border-color: rgba(255, 77, 77, 0.22);
    background: rgba(255, 77, 77, 0.08);
    color: #ffd0d0;
  }

  .collapse {
    padding: 0;
  }

  .collapse > summary {
    list-style: none;
    cursor: pointer;
    padding: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
  }

  .collapse > summary::-webkit-details-marker {
    display: none;
  }

  .collapse > summary::after {
    content: "▾";
    float: right;
    color: rgba(233, 238, 246, 0.7);
    transform: rotate(-90deg);
    transition: transform 140ms ease;
  }

  .collapse[open] > summary::after {
    transform: rotate(0deg);
  }

  .collapse__body {
    padding: 0 18px 18px;
  }

  .editor {
    display: grid;
    gap: 10px;
  }

  .editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .editor__sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 2px;
  }

  .editor__btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(233, 238, 246, 0.9);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 650;
    font-size: 13px;
    line-height: 1;
  }

  .editor__btn:hover {
    border-color: rgba(255, 255, 255, 0.18);
  }

  .editor__surface {
    min-height: 260px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    outline: none;
  }

  .editor__surface:focus {
    border-color: rgba(255, 255, 255, 0.18);
  }

  .editor__surface > *:first-child {
    margin-top: 0;
  }

  .prose {
    max-width: 100%;
  }

  .prose h1,
  .prose h2,
  .prose h3 {
    color: var(--text);
    margin: 26px 0 10px;
  }

  .prose p {
    color: var(--muted);
    max-width: 78ch;
  }

  .prose a {
    color: rgba(233, 238, 246, 0.92);
    text-decoration: underline;
    text-decoration-color: rgba(233, 238, 246, 0.25);
    text-underline-offset: 3px;
  }

  .prose img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
  }

  .prose iframe {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #080c12;
  }

  .gdoc-embed {
    position: relative;
    width: 100%;
    margin: 14px 0 18px;
  }

  .gdoc-embed iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 900px;
  }

  .gdoc-embed.is-expanded iframe {
    width: 100% !important;
  }

  .gdoc-embed__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    position: relative;
    z-index: 3;
  }

  .gdoc-embed__controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
  }

  .gdoc-embed__btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 14, 20, 0.72);
    color: rgba(233, 238, 246, 0.92);
    border-radius: 999px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    backdrop-filter: blur(10px);
  }

  .gdoc-embed__btn:hover {
    border-color: rgba(255, 255, 255, 0.22);
  }

  .gdoc-embed__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  .prose ul,
  .prose ol {
    margin: 0 0 16px 18px;
    color: var(--muted);
    max-width: 78ch;
  }

  .prose li {
    margin: 6px 0;
  }

  .gallery[hidden] {
    display: none;
  }

  .gallery {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 16px;
  }

  .gallery__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 10, 0.76);
    backdrop-filter: blur(4px);
  }

  .gallery__dialog {
    position: relative;
    width: min(980px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: #0c1118;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }

  .gallery__media-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 420px;
    background: #080c12;
  }

  .gallery__image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
  }

  .gallery__nav {
    border: 0;
    height: 100%;
    min-width: 64px;
    color: rgba(233, 238, 246, 0.9);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 30px;
  }

  .gallery__nav:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .gallery__close {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(10, 14, 20, 0.7);
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .gallery__meta {
    padding: 16px 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 10px;
  }

  .gallery__title {
    margin: 0;
    font-size: 20px;
  }

  .gallery__description {
    margin: 0;
    color: var(--muted);
  }
}

@layer utilities {
  .muted {
    color: var(--muted);
  }

  .mt-24 {
    margin-top: 24px;
  }

  .mt-16 {
    margin-top: 16px;
  }

  .nowrap {
    white-space: nowrap;
  }

  @media (max-width: 920px) {
    .hero__grid {
      grid-template-columns: 1fr;
    }

    .grid-2 {
      grid-template-columns: 1fr;
    }

    .grid-3 {
      grid-template-columns: 1fr;
    }

    .nav {
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .topbar__actions {
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .gallery__media-wrap {

    .gallery__media-wrap {
      min-height: 280px;
    }

    .gallery__nav {
      min-width: 48px;
    }

    .prose iframe {
      min-height: 420px;
      height: 70vh;
    }

    .gdoc-embed iframe {
      height: 70vh;
      min-height: 420px;
    }

    .gdoc-embed.is-expanded iframe {
      height: 1600px;
    }
  }
}

