/* ==========================================================================
   LOCAL FONT DEFINITION (JetBrains Mono from assets)
   ========================================================================== */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/JetBrainsMono-VariableFont_wght.ttf') format('truetype-variations'),
       url('assets/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
  /* Subtle Teal Accent */
  --ds-teal-500: #009688;
  --ds-teal-subtle: rgba(0, 150, 136, 0.1);
  --ds-teal-border: rgba(0, 150, 136, 0.35);

  /* Clean Dark Theme Palette */
  --bg-color: #0b0e14;
  --text-primary: #ededed;
  --text-secondary: #9aa4b2;
  --text-muted: #555e6d;
  --border-color: #21262d;
  --border-hover: #30363d;

  /* Typography */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  overflow-x: hidden;
}

::selection {
  background-color: var(--ds-teal-500);
  color: #ffffff;
}

/* ==========================================================================
   LAYOUT STRUCTURE (Centered Horizontally & Vertically - No Unwanted Scroll)
   ========================================================================== */
.site-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem clamp(1.25rem, 5vw, 2.5rem);
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  position: relative;
}

/* Subpages (Privacy, 404, etc.) */
.site-wrapper.privacy-wrapper,
.site-wrapper.subpage-wrapper,
.site-wrapper:has(.privacy-page-frame),
.site-wrapper:has(.subpage-frame) {
  justify-content: center;
  padding: 3rem clamp(1.25rem, 5vw, 2.5rem);
}

@media (max-height: 550px) {
  .site-wrapper.privacy-wrapper,
  .site-wrapper.subpage-wrapper,
  .site-wrapper:has(.privacy-page-frame),
  .site-wrapper:has(.subpage-frame) {
    justify-content: flex-start;
  }
}

.content-frame {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}

/* Specific frame for Privacy / 404 subpage reading width */
.privacy-page-frame,
.subpage-frame {
  max-width: 480px;
  gap: 1.5rem;
}

/* ==========================================================================
   HEADER / TITLES
   ========================================================================== */
.header-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* ==========================================================================
   LINKS LIST (Tight, Text Left, Button Right)
   ========================================================================== */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.row-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ds-teal-500);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.action-btn:hover,
.action-btn:focus-visible {
  border-color: var(--ds-teal-500);
  background: var(--ds-teal-subtle);
  color: #ffffff;
  outline: none;
}

/* ==========================================================================
   PRIVACY PAGE STYLES
   ========================================================================== */
.privacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-exit-icon {
  font-size: 0.85rem;
}

.btn-exit:hover,
.btn-exit:focus-visible {
  border-color: var(--ds-teal-500);
  color: var(--ds-teal-500);
  background: var(--ds-teal-subtle);
  outline: none;
}

.privacy-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.privacy-body p {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.privacy-body strong {
  color: var(--text-primary);
  font-weight: 500;
}

.privacy-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.text-link {
  color: var(--ds-teal-500);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.78rem;
  transition: color 0.15s ease;
}

.text-link:hover {
  color: #ffffff;
}

/* Built With Tags (Centered, wider horizontally, no hover animation) */
.built-with-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2.25rem;
  width: 100%;
}

.tag-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.tag-badge {
  width: 125px;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* ==========================================================================
   CORNER PRIVACY LINK (Pinned to Bottom-Right Corner)
   ========================================================================== */
.corner-privacy {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  right: max(1.75rem, env(safe-area-inset-right, 1.75rem));
  z-index: 100;
  margin: 0;
  display: flex;
}

@media (max-width: 600px) {
  .corner-privacy {
    bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
    right: max(1.25rem, env(safe-area-inset-right, 1.25rem));
  }
}

.privacy-link {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-color);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.privacy-link:hover,
.privacy-link:focus-visible {
  color: var(--ds-teal-500);
  text-decoration-color: var(--ds-teal-500);
  outline: none;
}
