/* ==========================================================================
   Polarys Studio - Official Design System
   Website: polarys.cc | Linktree Domain: links.polarys.cc
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Theme Variables (Border Radius strictly 0px)
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;

  /* Light Theme Palette */
  --background: #ffffff;
  --foreground: #09090b;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --surface-3: #e4e4e7;
  
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --muted-foreground: rgba(0, 0, 0, 0.6);
  
  --card: #ffffff;
  --card-foreground: #09090b;
  
  --primary: #09090b;
  --primary-foreground: #ffffff;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);

  /* Strict Zero Border Radius for Polarys Aesthetic */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-full: 0px;

  --transition-fast: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dark Theme Default & Classes */
.dark, :root[data-theme="dark"] {
  --background: #000000;
  --foreground: #ffffff;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --surface-3: #1a1a1a;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --muted-foreground: rgba(255, 255, 255, 0.55);

  --card: #111111;
  --card-foreground: #ffffff;

  --primary: #ffffff;
  --primary-foreground: #000000;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --background: #000000;
    --foreground: #ffffff;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #1a1a1a;

    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --muted-foreground: rgba(255, 255, 255, 0.55);

    --card: #111111;
    --card-foreground: #ffffff;

    --primary: #ffffff;
    --primary-foreground: #000000;
  }
}

/* --------------------------------------------------------------------------
   2. Reset & Base Layout (Zero Radius Enforced)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.011em;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body.modal-open {
  overflow: hidden;
}

/* Polarys Noise Overlay Utility */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 10;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Page Wrapper */
.page-wrapper {
  width: 100%;
  max-width: 500px;
  padding: 90px 20px 50px 20px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. Top Navigation Header (z-index: 50)
   -------------------------------------------------------------------------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 50; /* Below modals (9999) */
  padding: 14px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--line);
}

.dark .top-nav, :root[data-theme="dark"] .top-nav {
  background: rgba(0, 0, 0, 0.75);
}
:root[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.85);
}

.nav-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.blink-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 0 !important;
  background-color: var(--foreground);
  animation: polarysBlink 1.2s steps(1) infinite;
}

@keyframes polarysBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.theme-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--foreground);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--line-strong);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

:root[data-theme="dark"] .sun-icon { display: block; }
:root[data-theme="dark"] .moon-icon { display: none; }
:root[data-theme="light"] .sun-icon { display: none; }
:root[data-theme="light"] .moon-icon { display: block; }

/* --------------------------------------------------------------------------
   4. Profile & Studio Header
   -------------------------------------------------------------------------- */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-box-img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.logo-box-img:hover {
  border-color: var(--foreground);
}

.profile-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
}

.eyebrow-tag {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 500;
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--foreground);
  margin-top: 4px;
}

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--muted-foreground);
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  max-width: 380px;
  line-height: 1.5;
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   5. Links Section
   -------------------------------------------------------------------------- */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--foreground);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.link-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.highlight-card {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.highlight-card .card-subtitle, .highlight-card .card-action svg {
  color: var(--primary-foreground);
  opacity: 0.8;
}

.highlight-card:hover {
  opacity: 0.92;
  border-color: var(--primary);
  background: var(--primary);
}

.card-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--background);
}

.highlight-card .card-icon {
  background: var(--primary-foreground);
  border-color: transparent;
}
.highlight-card .card-icon svg {
  color: var(--primary);
}

.card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--foreground);
}

.card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.card-action svg {
  width: 18px;
  height: 18px;
  color: var(--muted-foreground);
  transition: transform var(--transition-fast);
}

.link-card:hover .card-action svg {
  transform: translate(2px, -2px);
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   6. Horizontal Image Showcase Carousel (1:1 Aspect Ratio)
   -------------------------------------------------------------------------- */
.carousel-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 500;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.carousel-container {
  position: relative;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 0 16px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 78%;
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

.carousel-slide:hover {
  border-color: var(--line-strong);
}

.image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: var(--surface-2);
}

.image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.carousel-slide:hover .image-wrapper img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 65%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  color: #ffffff;
}

.image-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.image-sub {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Carousel Controls */
.carousel-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.carousel-arrow:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.carousel-arrow svg {
  width: 18px;
  height: 18px;
}

.prev-arrow { left: -10px; }
.next-arrow { right: -10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--line-strong);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dot.active {
  width: 18px;
  background: var(--foreground);
}

/* --------------------------------------------------------------------------
   7. 4 Pricing Cards & Cycle Selector
   -------------------------------------------------------------------------- */
.pricing-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

/* 3-Way Segmented Cycle Switcher */
.cycle-tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px;
  margin-top: 8px;
  width: 100%;
}

.cycle-tab {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--muted-foreground);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cycle-tab:hover {
  color: var(--foreground);
}

.cycle-tab.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Pricing Grid */
.pricing-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.price-card:hover {
  border-color: var(--line-strong);
}

.popular-card {
  border: 1px solid var(--foreground);
  background: var(--surface-2);
}

.popular-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-header {
  display: flex;
  flex-direction: column;
}

.plan-name {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.plan-subtitle {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.currency {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--foreground);
}

.amount {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.period {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-left: 2px;
}

.billed-note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: -6px;
  font-weight: 500;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.features-list li {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
}

.check-icon {
  width: 14px;
  height: 14px;
  color: var(--foreground);
  flex-shrink: 0;
}

.plan-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--foreground);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.plan-btn:hover {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

.popular-btn {
  background: var(--foreground);
  color: var(--background);
  border: 1px solid var(--foreground);
}

.popular-btn:hover {
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   8. Direct Inquiry Section
   -------------------------------------------------------------------------- */
.inquiry-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.inquiry-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inquiry-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--foreground);
  transition: all var(--transition-fast);
}

.inquiry-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.inquiry-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--background);
}

.inquiry-icon svg {
  width: 18px;
  height: 18px;
  color: var(--foreground);
}

.inquiry-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.inquiry-title {
  font-weight: 500;
  font-size: 0.9rem;
}

.inquiry-val {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.action-pill {
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 5px 10px;
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   9. Modals (z-index: 9999 completely above header 50)
   -------------------------------------------------------------------------- */
.lightbox-modal, .inquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 9999; /* Completely above top-nav header (z-index 50) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.lightbox-modal.active, .inquiry-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop, .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--line);
}

.lightbox-caption {
  margin-top: 12px;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.9rem;
}

.lightbox-close, .modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
}

.modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: var(--background);
  border: 1px solid var(--line-strong);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.highlight-text {
  color: var(--muted-foreground);
  font-style: italic;
  font-family: var(--font-serif);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modal Option Link Cards */
.modal-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--foreground);
  background: var(--surface);
  transition: all var(--transition-fast);
}

.modal-option:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.modal-opt-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-opt-icon svg {
  width: 18px;
  height: 18px;
  color: var(--foreground);
}

.modal-option span {
  flex-grow: 1;
}

.modal-arrow {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  transition: transform var(--transition-fast);
}

.modal-option:hover .modal-arrow {
  transform: translate(2px, -2px);
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.page-footer {
  text-align: center;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.footer-domain {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  opacity: 0.7;
}
