/* Terra Browser — editorial / organic-modern theme
   Palette derived from the logo: leaf-green → teal → river-blue on warm paper. */

:root {
  --green: #3dbe4b;
  --teal:  #1fb6a6;
  --blue:  #1e9be0;
  --grad:  linear-gradient(105deg, var(--green) 0%, var(--teal) 48%, var(--blue) 100%);

  --paper:      #f7f6f0;
  --paper-2:    #fffefb;
  --ink:        #16241d;
  --ink-soft:   #4a5a52;
  --ink-faint:  #8a978f;
  --line:       #e4e2d7;
  --line-2:     #edece3;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 36, 29, 0.04), 0 14px 40px -22px rgba(22, 36, 29, 0.28);
  --shadow-hover: 0 2px 6px rgba(22, 36, 29, 0.06), 0 28px 60px -28px rgba(30, 155, 224, 0.4);

  --wrap: 1180px;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --serif: "Fraunces", ui-serif, Georgia, serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 82% -8%, rgba(30, 155, 224, 0.09), transparent 60%),
    radial-gradient(900px 520px at 0% 4%, rgba(61, 190, 75, 0.10), transparent 55%),
    var(--paper);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle film grain for paper texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 2; }

.site-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 28px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; }
.brand__mark {
  height: 54px;
  width: auto;
  display: block;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand:hover .brand__mark { transform: scale(1.03) rotate(-1deg); }

.brand__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.site-header__rule {
  height: 3px;
  background: var(--grad);
  opacity: 0.85;
}

/* ---------- Layout ---------- */
.site-main {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 52px; max-width: 760px; }
.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 60ch;
}
.hero__download { margin-top: 26px; }

/* ---------- Download ---------- */
.download-page {
  min-height: calc(100vh - 220px);
  padding: 58px 0 76px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.72fr);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
}

.download-copy { max-width: 660px; }

.download-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.download-kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: var(--grad);
}

.download-title {
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  max-width: 8.8ch;
}

.download-subtitle {
  margin-top: 26px;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
}

.download-capsule {
  position: relative;
  isolation: isolate;
  padding: 22px;
  border: 1px solid rgba(228, 226, 215, 0.92);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 254, 251, 0.94), rgba(242, 248, 244, 0.88)) padding-box,
    var(--grad) border-box;
  box-shadow: 0 30px 90px -48px rgba(22, 36, 29, 0.55), 0 18px 54px -42px rgba(30, 155, 224, 0.72);
  overflow: hidden;
  animation: rise 0.7s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.download-capsule::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
}

.download-capsule__glow {
  position: absolute;
  width: 260px;
  height: 260px;
  top: -96px;
  right: -80px;
  z-index: -2;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(31, 182, 166, 0.34), rgba(30, 155, 224, 0.16) 44%, transparent 70%);
  filter: blur(6px);
}

.download-capsule__topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.download-capsule__size { color: var(--blue); }

.download-capsule__body {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 34px;
}

.download-orb {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: #13231b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 34px -24px rgba(22, 36, 29, 0.9);
}
.download-orb span {
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 8px;
  background: var(--grad);
  transform: rotate(-22deg);
  box-shadow: 0 0 28px rgba(31, 182, 166, 0.55);
}

.download-filename {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.download-note {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.download-id-panel {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid rgba(228, 226, 215, 0.92);
  border-radius: 20px;
  background: rgba(247, 246, 240, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.download-id-panel__label {
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.download-id-panel__value {
  padding: 6px 10px;
  border-radius: 999px;
  background: #16241d;
  color: #9ff0b0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.download-button {
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  border-radius: 22px;
  background: #16241d;
  color: #fff;
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  box-shadow: 0 20px 40px -26px rgba(22, 36, 29, 0.88);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
}
.download-button:hover {
  transform: translateY(-3px);
  background: #0f1b15;
  box-shadow: 0 26px 54px -30px rgba(22, 36, 29, 0.95);
}
.download-button:focus-visible {
  outline: 3px solid rgba(30, 155, 224, 0.38);
  outline-offset: 4px;
}
.download-button__arrow {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--grad);
  font-size: 0.78rem;
  line-height: 1;
  transition: transform 0.3s ease;
}
.download-button:hover .download-button__arrow { transform: translateY(3px); }

.download-status {
  margin-top: 14px;
  color: var(--ink-faint);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Feed grid ---------- */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  animation: rise 0.6s both cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.card:hover::before { transform: scaleX(1); }

.card__link { display: flex; flex-direction: column; height: 100%; padding: 24px 24px 22px; }

.card__image-wrap {
  position: relative;
  margin: -10px -10px 20px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--line-2);
  background:
    linear-gradient(135deg, rgba(61, 190, 75, 0.10), rgba(30, 155, 224, 0.12)),
    #edf2ec;
}
.card__image-wrap::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--grad);
  opacity: 0.86;
  box-shadow: 0 0 18px rgba(31, 182, 166, 0.35);
}
.card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.02);
  transform: scale(1.001);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.45s ease;
}
.card:hover .card__image { transform: scale(1.045); filter: saturate(1.08) contrast(1.04); }

.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
}
.card__source {
  color: var(--teal);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__time::before { content: "· "; color: var(--ink-faint); }

.card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.42rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 14px 0 0;
}
.card__excerpt {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.card__cue {
  margin-top: auto;
  padding-top: 18px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.card__arrow { transition: transform 0.3s ease; }
.card:hover .card__arrow { transform: translateX(5px); }

/* ---------- Pagination ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 48px;
}
.pager__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.pager__btn:hover {
  transform: translateY(-2px);
  border-color: transparent;
  color: var(--blue);
  box-shadow: var(--shadow-hover);
}
.pager__btn--off {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}
.pager__arrow { transition: transform 0.3s ease; }
.pager__btn:hover .pager__arrow { transform: translateX(3px); }
.pager__btn:first-child:hover .pager__arrow { transform: translateX(-3px); }
.pager__page {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}

/* ---------- Article (detail) ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 56px 0 40px; }

.article__back {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}
.article__back:hover { color: var(--teal); }

.article__meta {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink-faint);
}
.article__source { color: var(--teal); }

.article__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
}

.article__image-plate {
  position: relative;
  margin-top: 32px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background:
    linear-gradient(var(--paper-2), var(--paper-2)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--shadow);
}
.article__image-plate::after {
  content: "";
  display: block;
  height: 3px;
  margin: 10px 4px 0;
  border-radius: 999px;
  background: var(--grad);
  opacity: 0.9;
}
.article__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  border-radius: calc(var(--radius) + 1px);
  background: #edf2ec;
}
.article__image-caption {
  margin: 10px 4px 0;
  color: var(--ink-faint);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 600;
}

.article__body {
  margin-top: 28px;
  font-size: 1.16rem;
  line-height: 1.75;
  color: #26332c;
}
.article__body > * + * { margin-top: 1.05em; }
.article__body p { margin: 0; }
.article__body a {
  color: #126f9f;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(31, 182, 166, 0.42);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.article__body a:hover { color: var(--teal); text-decoration-color: currentColor; }
.article__body ul,
.article__body ol {
  padding-left: 1.3em;
}
.article__body li + li { margin-top: 0.45em; }
.article__body blockquote {
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--teal);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.06em;
}
.article__body strong { color: var(--ink); }
.article__body em { color: var(--ink-soft); }
.article__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article__actions { margin-top: 40px; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  box-shadow: 0 12px 30px -12px rgba(30, 155, 224, 0.7);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, filter 0.3s ease;
}
.btn:hover { transform: translateY(-2px); filter: saturate(1.1); box-shadow: 0 18px 40px -14px rgba(30, 155, 224, 0.8); }
.btn__arrow { transition: transform 0.3s ease; }
.btn:hover .btn__arrow { transform: translate(3px, -3px); }

/* ---------- Empty / 404 ---------- */
.empty {
  text-align: center;
  padding: 90px 20px 80px;
  max-width: 480px;
  margin: 0 auto;
}
.empty__mark { font-size: 3.4rem; line-height: 1; }
.empty h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  margin: 20px 0 10px;
  letter-spacing: -0.01em;
}
.empty p { color: var(--ink-soft); margin-bottom: 26px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.6);
}
.site-footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.site-footer__dot { color: var(--line); }

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .site-header__inner { padding: 20px 20px 16px; }
  .brand__mark { height: 44px; }
  .brand__tagline { display: none; }
  .site-main { padding: 0 20px 64px; }
  .hero { padding: 44px 0 36px; }
  .download-page { grid-template-columns: 1fr; padding: 42px 0 58px; gap: 30px; }
  .download-title { max-width: 10ch; }
  .download-capsule { padding: 18px; border-radius: 28px; }
  .download-capsule__body { grid-template-columns: 1fr; gap: 16px; margin-top: 26px; }
  .download-orb { width: 68px; height: 68px; border-radius: 22px; }
  .download-id-panel { align-items: flex-start; flex-direction: column; }
  .feed { grid-template-columns: 1fr; }
  .card__image-wrap { margin: -8px -8px 18px; }
  .article__image-plate { margin-top: 26px; padding: 8px; border-radius: var(--radius); }
}
