/* ==========================================================================
   minchin.dev — Dark Minimalist Architectural Stylesheet
   ========================================================================== */

:root {
  --bg: #070709;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.18);
  --ink: #f4f4f6;
  --ink-secondary: #92929e;
  --ink-muted: #565662;
  --accent-emerald: #34d399;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100svh;
  background-color: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Ambient Atmospheric Layers
   -------------------------------------------------------------------------- */

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 42%, #000 15%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 42%, #000 15%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(196, 214, 255, 0.085), transparent 70%),
    radial-gradient(40% 35% at 85% 95%, rgba(255, 255, 255, 0.03), transparent 75%);
}

.bg-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 40%),
    rgba(255, 255, 255, 0.042),
    transparent 65%
  );
}

.bg-spotlight.is-active {
  opacity: 1;
}

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

/* --------------------------------------------------------------------------
   Layout Shell
   -------------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 4vw, 3rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 5vh, 4rem);
}

/* --------------------------------------------------------------------------
   Top Navigation Bar
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand-tld {
  color: var(--ink-secondary);
  font-weight: 400;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.65);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

/* --------------------------------------------------------------------------
   Main Stage & Architectural Framing
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3rem, 7vh, 5.25rem);
  padding: clamp(2rem, 5vh, 3.75rem) clamp(0.25rem, 2vw, 2rem);
}

.frame-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(255, 255, 255, 0.16);
  border-style: solid;
  border-width: 0;
}

.corner-tl {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
}

.corner-tr {
  top: 0;
  right: 0;
  border-top-width: 1px;
  border-right-width: 1px;
}

.corner-bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.corner-br {
  bottom: 0;
  right: 0;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* --------------------------------------------------------------------------
   Hero Typography & Actions
   -------------------------------------------------------------------------- */

.hero {
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 1.5rem;
}

.eyebrow-index {
  color: var(--ink);
}

.eyebrow-sep {
  color: var(--ink-muted);
}

.headline {
  font-size: clamp(2.5rem, 6.4vw, 4.85rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 1.65rem;
}

.headline-muted {
  background: linear-gradient(180deg, rgba(244, 244, 246, 0.76) 0%, rgba(146, 146, 158, 0.45) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subcopy {
  max-width: 50ch;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--ink-secondary);
  margin-bottom: 2.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 46px;
  padding: 0 1.35rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.22s var(--ease-out-expo),
    border-color 0.22s var(--ease-out-expo),
    color 0.22s var(--ease-out-expo),
    transform 0.22s var(--ease-out-expo),
    box-shadow 0.22s var(--ease-out-expo);
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--ink);
  color: #070709;
  border: 1px solid var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 28px rgba(255, 255, 255, 0.08);
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.14);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.22s var(--ease-out-expo);
}

.btn-primary:hover .btn-arrow {
  transform: translate(2px, -2px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary .icon-copy,
.btn-secondary .icon-check {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-secondary .icon-check {
  display: none;
  color: var(--accent-emerald);
}

.btn-secondary.is-copied {
  border-color: rgba(52, 211, 153, 0.38);
  color: var(--ink);
}

.btn-secondary.is-copied .icon-copy {
  display: none;
}

.btn-secondary.is-copied .icon-check {
  display: block;
}

/* --------------------------------------------------------------------------
   Architectural Spec Strip
   -------------------------------------------------------------------------- */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.25rem 1.25rem 1.25rem 0;
}

.spec-cell + .spec-cell {
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.spec-value,
.spec-link {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink-secondary);
}

.spec-link {
  text-decoration: none;
  transition: color 0.2s ease;
  width: fit-content;
}

.spec-link:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.footer-clock {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Entrance Choreography
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.75s var(--ease-out-expo) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Responsive & Reduced Motion
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  .stage {
    padding: 1.75rem 0.25rem;
  }

  .frame-corners {
    display: none;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-cell {
    padding: 1rem 0;
  }

  .spec-cell + .spec-cell {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .status-dot {
    animation: none;
  }

  .bg-spotlight {
    display: none;
  }

  .btn,
  .btn-arrow {
    transition: none;
  }
}
