/* ==========================================================================
   Rockyspring Tech — site stylesheet
   Design system ported from Roughcut iOS (Offcut_IOS repo, Design/Theme.swift)
   "Rustic professional" — wood tones, serif headers, parchment cards
   ========================================================================== */

:root {
  /* Dark tones - anchoring colors */
  --bark: #3A3632;        /* Dark charcoal brown */
  --walnut: #6B7264;      /* Sage gray */
  --grain: #7A7A5E;       /* Olive */

  /* Neutrals - warm greige tones */
  --sawdust: #DDD5C9;     /* Warm beige */
  --parchment: #E5E0D8;   /* Light cream */
  --iron: #9E9680;        /* Warm taupe */

  /* Accents - forest greens */
  --forest: #3D4A3A;      /* Deep forest green */
  --rust: #85856B;        /* Muted olive */
  --copper: #C5BBA8;      /* Greige */

  /* Semantic */
  --error: #8C5952;       /* Muted terracotta */

  --font-serif: Georgia, "Times New Roman", "Palatino", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-card: 12px;
  --radius-button: 10px;
  --shadow-soft: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-medium: 0 6px 12px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   Wood grain background
   Base: the app's WoodGrainBackground gradient (forest → walnut → bark),
   with layered translucent streaks for a subtle grain texture.
   -------------------------------------------------------------------------- */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--parchment);
  font: 17px/1.65 var(--font-sans);
  background-color: var(--bark);
  background-image:
    /* fine grain lines */
    repeating-linear-gradient(
      100deg,
      rgba(0, 0, 0, 0.00) 0px,
      rgba(0, 0, 0, 0.00) 7px,
      rgba(0, 0, 0, 0.08) 8px,
      rgba(0, 0, 0, 0.00) 11px,
      rgba(58, 54, 50, 0.10) 14px,
      rgba(0, 0, 0, 0.00) 21px
    ),
    /* broad plank-like bands */
    repeating-linear-gradient(
      96deg,
      rgba(229, 224, 216, 0.03) 0px,
      rgba(0, 0, 0, 0.00) 40px,
      rgba(0, 0, 0, 0.06) 90px,
      rgba(0, 0, 0, 0.00) 140px
    ),
    /* the app's signature gradient */
    linear-gradient(135deg, var(--forest), var(--walnut), var(--bark));
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: bold;
  line-height: 1.25;
}

a { color: var(--copper); }
a:hover { color: var(--parchment); }

.measurement { font-family: var(--font-mono); font-weight: 500; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Header + tab navigation
   -------------------------------------------------------------------------- */
.site-header {
  padding: 28px 0 0;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: bold;
  color: var(--parchment);
  /* EmbossedText from Theme.swift */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.tagline {
  margin: 6px 0 0;
  color: var(--sawdust);
  font-size: 15px;
  opacity: 0.85;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 28px auto 0;
  padding: 6px;
  width: fit-content;
  background: rgba(58, 54, 50, 0.55);
  border: 1px solid rgba(229, 224, 216, 0.15);
  border-radius: var(--radius-button);
}

.tab-link {
  padding: 10px 28px;
  font: 600 16px var(--font-sans);
  color: var(--sawdust);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-link:hover { color: var(--parchment); }

.tab-link.active {
  background: linear-gradient(to bottom, var(--walnut), var(--forest));
  color: var(--parchment);
  box-shadow: var(--shadow-soft);
}

/* Tab panels: shown/hidden via .active class (see inline script) */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

main { padding: 40px 0 64px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 24px 0 8px;
}

.hero img.wordmark {
  max-width: 320px;
  width: 70%;
  height: auto;
}

.hero h1 {
  font-size: 40px;
  margin: 12px 0 8px;
  color: var(--parchment);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto;
  font-size: 19px;
  color: var(--sawdust);
}

/* --------------------------------------------------------------------------
   Cards — RusticCardStyle: parchment, 12px radius, soft shadow
   -------------------------------------------------------------------------- */
.card {
  background: var(--parchment);
  color: var(--bark);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 32px 36px;
  margin: 28px 0;
}

.card h2 {
  margin-top: 0;
  color: var(--forest);
  font-size: 26px;
}

.card h3 { color: var(--forest); }
.card a { color: var(--forest); }
.card a:hover { color: var(--grain); }
.card .muted { color: var(--iron); font-size: 15px; }

/* --------------------------------------------------------------------------
   Buttons — RusticButtonStyle
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 14px 24px;
  font: 600 16px var(--font-sans);
  color: var(--parchment);
  text-decoration: none;
  background: linear-gradient(to bottom, var(--walnut), var(--forest));
  border: 1px solid rgba(61, 74, 58, 0.3);
  border-radius: var(--radius-button);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  cursor: pointer;
}

.btn:hover { color: var(--parchment); filter: brightness(1.08); }
.btn:active { transform: scale(0.98); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }

.btn.secondary {
  background: var(--sawdust);
  color: var(--bark);
}
.btn.secondary:hover { color: var(--bark); }

.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   App Store section
   -------------------------------------------------------------------------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.app-tile {
  text-align: center;
  padding: 24px;
  background: var(--sawdust);
  border: 1px solid var(--copper);
  border-radius: var(--radius-card);
}

.app-tile img.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;      /* iOS icon corner radius */
  box-shadow: var(--shadow-soft);
}

.app-tile h3 { margin: 14px 0 6px; font-size: 22px; }
.app-tile p { margin: 0 0 16px; font-size: 15px; color: var(--bark); }

.badge-coming-soon {
  display: inline-block;
  padding: 10px 20px;
  font: 600 14px var(--font-sans);
  color: var(--parchment);
  background: var(--iron);
  border-radius: var(--radius-button);
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Videos section
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.video-slot {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sawdust);
  border: 2px dashed var(--iron);
  border-radius: var(--radius-card);
  color: var(--iron);
  font: 600 15px var(--font-sans);
}

.video-slot video,
.video-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-card);
}

/* --------------------------------------------------------------------------
   Feedback board
   -------------------------------------------------------------------------- */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  font: 16px/1.4 var(--font-sans);
  color: var(--bark);
  background: #FFFDF9;
  border: 1px solid var(--iron);
  border-radius: var(--radius-button);
  padding: 10px 12px;
}

.feedback-form input { flex: 1; min-width: 180px; }
.feedback-form textarea { width: 100%; resize: vertical; }

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
  outline: 2px solid var(--forest);
  outline-offset: 0;
}

.feedback-form .btn {
  border: 1px solid rgba(61, 74, 58, 0.3);
  cursor: pointer;
}

.feedback-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-post {
  background: var(--sawdust);
  border-radius: var(--radius-card);
  padding: 14px 18px;
}

.feedback-post p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-post-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.fb-badge {
  font: 600 12px var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--parchment);
  background: var(--forest);
  padding: 3px 10px;
  border-radius: 999px;
}

.fb-name { font-weight: 600; color: var(--walnut); }
.fb-date { color: var(--iron); font-size: 14px; }

.fb-vote {
  margin-left: auto;
  font: 600 14px var(--font-sans);
  color: var(--forest);
  background: var(--parchment);
  border: 1px solid var(--iron);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
}

.fb-vote:hover:not([disabled]) { filter: brightness(1.05); }
.fb-vote[disabled] { opacity: 0.55; cursor: default; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 28px 0 40px;
  text-align: center;
  font-size: 14px;
  color: var(--sawdust);
  opacity: 0.85;
}

.site-footer a { color: var(--copper); }

/* --------------------------------------------------------------------------
   Privacy policy page
   -------------------------------------------------------------------------- */
.policy .date { color: var(--iron); font-size: 14px; margin-bottom: 8px; }
.policy h1 { color: var(--forest); margin: 0 0 4px; font-size: 32px; }
.policy h2 { color: var(--forest); font-size: 21px; margin: 34px 0 8px; }
.policy ul { padding-left: 22px; }
.policy li { margin: 5px 0; }
.policy code {
  background: #dcd5ca;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 14px;
}
.policy .note { color: var(--iron); font-size: 14px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .app-grid, .video-grid { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; }
  .hero h1 { font-size: 32px; }
  .tab-link { padding: 10px 20px; }
}
