/* ==========================================================================
   Circle47.net — Stage 01 Responsive Structural Stylesheet
   Palette derived directly from official Circle47.png brand asset.
   ========================================================================== */

:root {
  /* Core Midnight & Obsidian Palette (matched to Circle47.png perimeter) */
  --bg-void: #010a15;
  --bg-deep: #021124;
  --bg-royal: #051c3b;
  --bg-surface: rgba(5, 22, 46, 0.78);
  --bg-surface-hover: rgba(9, 34, 68, 0.92);
  --bg-surface-active: rgba(14, 46, 90, 0.96);

  /* Metallic Gold Spectrum */
  --gold-bright: #f7d77e;
  --gold-primary: #d8a444;
  --gold-warm: #cc8e41;
  --gold-deep: #9e6b21;
  --gold-border: rgba(216, 164, 68, 0.36);
  --gold-border-hover: rgba(247, 215, 126, 0.78);

  /* Typography Colors */
  --text-primary: #f2f4f8;
  --text-ivory: #f5e6c4;
  --text-muted: #9eb0c7;
  --text-placeholder: rgba(185, 200, 220, 0.56);

  /* Fonts */
  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Structural Transitions */
  --ease-elegant: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  background-color: var(--bg-void);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-void);
  font-family: var(--font-sans);
  color: var(--text-primary);
  position: relative;
}

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

/* ==========================================================================
   Atmospheric Background (Top-Right Kept Pure #010a15 for Seamless Logo Blend)
   ========================================================================== */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 56% 54%, rgba(12, 46, 94, 0.42) 0%, rgba(4, 21, 45, 0.24) 40%, rgba(1, 10, 21, 0) 68%),
    radial-gradient(ellipse at 12% 50%, rgba(10, 38, 78, 0.32) 0%, rgba(1, 10, 21, 0) 58%),
    var(--bg-void);
}

.bg-geometry {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.72;
}

/* ==========================================================================
   Shared Stage & Component Styling
   ========================================================================== */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
}

/* Brand Logo (Official Circle47.png — Unmodified 3:2 Aspect Ratio) */
.brand-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand-logo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-color: transparent;
  overflow: hidden;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Elliptical perimeter dissolve (50% 50% = true inscribed radii) for zero rectangular edge */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 66%, rgba(0, 0, 0, 0.86) 80%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 66%, rgba(0, 0, 0, 0.86) 80%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
  user-select: none;
  -webkit-user-drag: none;
}

/* Compact Language Selector */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(4, 18, 38, 0.85);
  border: 1px solid rgba(216, 164, 68, 0.28);
  color: var(--text-ivory);
  transition: border-color 0.2s var(--ease-elegant), background-color 0.2s var(--ease-elegant);
}

.lang-switcher:hover,
.lang-switcher:focus-within {
  border-color: var(--gold-border-hover);
  background: rgba(8, 28, 58, 0.95);
}

.lang-globe {
  display: inline-flex;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding-right: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23d8a444' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

.lang-select:focus {
  outline: none;
}

.lang-select option {
  background-color: #031328;
  color: var(--text-primary);
}

/* ==========================================================================
   10 Feature Strips (Base + Interaction States)
   ========================================================================== */
.strip-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  padding: 0;
  transition: transform 0.22s var(--ease-elegant), filter 0.22s var(--ease-elegant);
}

.strip-item:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 8px rgba(247, 215, 126, 0.45));
}

.strip-svg {
  display: none;
}

.strip-label {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: #e6ecf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.22s var(--ease-elegant), transform 0.22s var(--ease-elegant);
}

.strip-item:hover .strip-label,
.strip-item:focus-visible .strip-label {
  color: var(--gold-bright);
  transform: translateX(4px);
}

.strip-item.is-active .strip-label {
  color: var(--gold-bright);
  font-weight: 600;
  transform: translateX(5px);
}

/* ==========================================================================
   Protagonist Central Circle & Internal Access Layout
   ========================================================================== */
.circle-zone {
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-portal {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 24%, rgba(22, 68, 128, 0.42) 0%, rgba(6, 26, 56, 0.92) 48%, rgba(2, 12, 26, 0.98) 100%);
  border: 1.5px solid rgba(216, 164, 68, 0.62);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.72),
    0 0 46px rgba(204, 142, 65, 0.12),
    inset 0 1px 0 rgba(247, 215, 126, 0.28),
    inset 0 -18px 40px rgba(1, 8, 18, 0.65);
}

.circle-bezel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.circle-ornament {
  width: 100%;
  height: 100%;
  display: block;
}

.circle-content {
  position: relative;
  z-index: 2;
  width: 68%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.circle-header {
  width: 100%;
  margin-bottom: clamp(10px, 1.5vh, 16px);
}

.circle-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.12rem, 2.15vh, 1.65rem);
  letter-spacing: 0.055em;
  line-height: 1.2;
  color: var(--text-ivory);
  text-shadow: 0 2px 14px rgba(216, 164, 68, 0.25);
}

.circle-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 0;
  width: 68%;
}

.rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 164, 68, 0.62), transparent);
}

.rule-diamond {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(247, 215, 126, 0.6);
}

.circle-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.15vh, 12px);
}

.field-group {
  width: 100%;
}

.circle-input {
  width: 100%;
  height: clamp(38px, 4.4vh, 44px);
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(2, 12, 26, 0.78);
  border: 1px solid rgba(216, 164, 68, 0.3);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  transition: border-color 0.2s var(--ease-elegant), box-shadow 0.2s var(--ease-elegant), background-color 0.2s var(--ease-elegant);
}

.circle-input::placeholder {
  color: var(--text-placeholder);
}

.circle-input:hover {
  border-color: rgba(216, 164, 68, 0.52);
}

.circle-input:focus {
  outline: none;
  border-color: var(--gold-bright);
  background: rgba(3, 17, 36, 0.94);
  box-shadow: 0 0 0 3px rgba(216, 164, 68, 0.16);
}

.form-actions-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.btn-signin {
  width: 100%;
  height: clamp(38px, 4.4vh, 43px);
  border-radius: 10px;
  border: 1px solid rgba(216, 164, 68, 0.62);
  background: linear-gradient(180deg, rgba(16, 48, 92, 0.92) 0%, rgba(8, 28, 58, 0.96) 100%);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-elegant), background 0.2s var(--ease-elegant), color 0.2s var(--ease-elegant);
}

.btn-signin:hover,
.btn-signin:focus-visible {
  outline: none;
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(22, 62, 118, 0.96) 0%, rgba(10, 35, 72, 0.98) 100%);
  color: var(--gold-bright);
}

.link-forgot {
  background: none;
  border: none;
  padding: 2px 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s var(--ease-elegant);
}

.link-forgot:hover,
.link-forgot:focus-visible {
  outline: none;
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.circle-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 82%;
  margin: 1px auto;
  color: rgba(216, 164, 68, 0.65);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.circle-divider::before,
.circle-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 164, 68, 0.35), transparent);
}

/* Primary Commercial CTA */
.btn-signup-cta {
  width: 100%;
  height: clamp(42px, 4.9vh, 48px);
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 232, 166, 0.78);
  background: linear-gradient(135deg, #f5d37b 0%, #d8a03c 50%, #b87c22 100%);
  color: #041020;
  font-family: var(--font-sans);
  font-size: clamp(0.84rem, 1.35vh, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(204, 142, 65, 0.28),
    inset 0 1px 0 rgba(255, 248, 224, 0.65);
  transition: transform 0.2s var(--ease-elegant), box-shadow 0.2s var(--ease-elegant), filter 0.2s var(--ease-elegant);
}

.btn-signup-cta:hover,
.btn-signup-cta:focus-visible {
  outline: none;
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 10px 30px rgba(247, 215, 126, 0.36),
    inset 0 1px 0 rgba(255, 250, 230, 0.85);
}

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

.stage-feedback {
  min-height: 16px;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--gold-bright);
  opacity: 0;
  transition: opacity 0.2s var(--ease-elegant);
}

.stage-feedback.is-visible {
  opacity: 0.92;
}

/* Discreet Meaning Bar (Circle · 47 · .NET) */
.meaning-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: rgba(216, 164, 68, 0.72);
  user-select: none;
}

.meaning-token {
  cursor: help;
  transition: color 0.2s var(--ease-elegant);
}

.meaning-token:hover {
  color: var(--gold-bright);
}

.meaning-sep {
  opacity: 0.45;
}

/* ==========================================================================
   DESKTOP & LANDSCAPE TABLET STAGE (Faithful Wireframe Geometry)
   ========================================================================== */
@media (min-width: 960px) and (min-height: 620px) {
  body {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .stage {
    width: min(94vw, 172dvh);
    height: min(90dvh, 980px);
    position: relative;
  }

  /* Top-right logo aligned to top of Strip 1 & right edge of stage */
  .brand-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: clamp(200px, 22.5%, 345px);
    align-items: flex-end;
    z-index: 20;
  }

  .lang-switcher {
    margin-top: 2px;
  }

  /* Left column: 10 equal-height strips spanning vertical stage height */
  .strips-column {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 62%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(6px, 1.05dvh, 13px);
    pointer-events: none;
    z-index: 10;
  }

  .strip-item {
    flex: 1 1 0;
    min-height: 0;
    pointer-events: auto;
    /* Fallback shape before JS exact circular arc calculation */
    width: 340px;
  }

  .strip-svg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
  }

  .strip-path-fill {
    fill: url(#stripGradDefault);
    transition: fill 0.22s var(--ease-elegant);
  }

  .strip-path-stroke {
    fill: none;
    stroke: rgba(216, 164, 68, 0.36);
    stroke-width: 1.25;
    transition: stroke 0.22s var(--ease-elegant), stroke-width 0.22s var(--ease-elegant);
  }

  .strip-item:hover .strip-path-fill,
  .strip-item:focus-visible .strip-path-fill {
    fill: url(#stripGradHover);
  }

  .strip-item:hover .strip-path-stroke,
  .strip-item:focus-visible .strip-path-stroke {
    stroke: rgba(247, 215, 126, 0.85);
    stroke-width: 1.5;
  }

  .strip-item.is-active .strip-path-fill {
    fill: url(#stripGradActive);
  }

  .strip-item.is-active .strip-path-stroke {
    stroke: rgba(247, 215, 126, 0.98);
    stroke-width: 1.65;
  }

  .strip-label {
    padding-left: clamp(18px, 2vw, 32px);
    padding-right: 48px;
    font-size: clamp(0.84rem, 1.55dvh, 1.05rem);
  }

  /* Central protagonist circle matching wireframe position & scale */
  .circle-zone {
    position: absolute;
    left: 56.8%;
    top: 53.5%;
    transform: translate(-50%, -50%);
    z-index: 15;
  }

  .circle-portal {
    width: clamp(395px, min(67dvh, 41.5vw), 610px);
    height: clamp(395px, min(67dvh, 41.5vw), 610px);
  }

  /* Discreet meaning reference in bottom-right negative space */
  .meaning-bar {
    position: absolute;
    right: 0;
    bottom: 2px;
    z-index: 12;
  }
}

/* ==========================================================================
   TABLET PORTRAIT & SMALL DESKTOP / MOBILE LANDSCAPE FALLBACKS
   ========================================================================== */
@media (max-width: 959px), (max-height: 619px) {
  body {
    overflow-y: auto;
    padding: clamp(14px, 2.8vw, 24px) clamp(14px, 3.5vw, 28px) 28px;
  }

  .stage {
    max-width: 920px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2.4vh, 22px);
  }

  .brand-zone {
    order: 1;
    width: min(68vw, 250px);
    gap: 6px;
  }

  .circle-zone {
    order: 2;
    width: 100%;
  }

  .circle-portal {
    width: min(82vw, 405px);
    height: min(82vw, 405px);
  }

  .circle-content {
    width: 70%;
  }

  .circle-header {
    margin-bottom: 10px;
  }

  .circle-form {
    gap: 8px;
  }

  .circle-input,
  .btn-signin {
    height: 38px;
  }

  .btn-signup-cta {
    height: 42px;
  }

  .strips-column {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
  }

  .strip-item {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(8, 30, 62, 0.9) 0%, rgba(4, 18, 38, 0.78) 100%);
    border: 1px solid var(--gold-border);
    box-shadow: inset 3px 0 0 rgba(216, 164, 68, 0.48);
    transition: border-color 0.2s var(--ease-elegant), background 0.2s var(--ease-elegant), box-shadow 0.2s var(--ease-elegant);
  }

  .strip-item:hover,
  .strip-item:focus-visible {
    border-color: var(--gold-border-hover);
    background: linear-gradient(90deg, rgba(14, 46, 90, 0.95) 0%, rgba(6, 26, 54, 0.88) 100%);
    box-shadow: inset 4px 0 0 var(--gold-bright), 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  .strip-item.is-active {
    border-color: var(--gold-bright);
    background: linear-gradient(90deg, rgba(22, 62, 114, 0.96) 0%, rgba(10, 34, 68, 0.92) 100%);
    box-shadow: inset 5px 0 0 var(--gold-bright), 0 0 22px rgba(216, 164, 68, 0.22);
  }

  .strip-label {
    font-size: 0.9rem;
  }

  .meaning-bar {
    order: 4;
    margin-top: 4px;
  }
}

/* Wide short mobile landscape (e.g. 844x390, 915x412) */
@media (max-height: 619px) and (min-width: 640px) {
  .stage {
    display: grid;
    grid-template-columns: minmax(340px, 46%) 1fr;
    grid-template-areas:
      "brand brand"
      "circle strips"
      "meaning meaning";
    align-items: center;
    gap: 14px 22px;
  }

  .brand-zone {
    grid-area: brand;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo-wrap {
    width: 190px;
  }

  .circle-zone {
    grid-area: circle;
  }

  .circle-portal {
    width: min(100%, 376px);
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 22px 0;
  }

  .circle-content {
    width: 74%;
  }

  .circle-title {
    font-size: 1.05rem;
  }

  .circle-header {
    margin-bottom: 8px;
  }

  .circle-rule {
    margin-top: 5px;
  }

  .circle-form {
    gap: 7px;
  }

  .circle-input,
  .btn-signin {
    height: 35px;
    font-size: 0.82rem;
  }

  .btn-signup-cta {
    height: 39px;
    font-size: 0.82rem;
  }

  .strips-column {
    grid-area: strips;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    align-self: center;
  }

  .strip-item {
    min-height: 44px;
    padding: 0 14px;
  }

  .strip-label {
    font-size: 0.84rem;
  }

  .meaning-bar {
    grid-area: meaning;
  }
}

/* Mobile Portrait (<= 579px) */
@media (max-width: 579px) {
  body {
    padding: 14px 10px 28px;
  }

  .brand-zone {
    width: min(72vw, 246px);
    gap: 6px;
  }

  .circle-portal {
    width: min(94vw, 396px);
    height: min(94vw, 396px);
    aspect-ratio: 1 / 1;
    padding: 18px 0;
  }

  .circle-content {
    width: 73%;
  }

  .circle-title {
    font-size: 1.06rem;
  }

  .circle-rule {
    margin-top: 5px;
  }

  .circle-header {
    margin-bottom: 8px;
  }

  .circle-form {
    gap: 7px;
  }

  .circle-input,
  .btn-signin {
    height: 36px;
    font-size: 0.82rem;
  }

  .btn-signup-cta {
    height: 40px;
    font-size: 0.82rem;
  }

  .strips-column {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .strip-item {
    min-height: 48px;
    padding: 0 16px;
  }
}

/* Ultra-narrow screens (<= 349px) */
@media (max-width: 349px) {
  .circle-portal {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    min-height: 360px;
    border-radius: 175px;
    padding: 28px 18px;
  }

  .circle-content {
    width: 86%;
  }

  .circle-bezel {
    display: none;
  }
}
