/*
 * Aanmanalam Magazine — Coming Soon page.
 * Colours and fonts follow the main site (assets/css/main.css in the full website).
 */

:root {
  --gold-50: #FFF9EE;
  --gold-100: #FEF1D6;
  --gold-200: #FDE2AE;
  --gold-300: #FBCD78;
  --gold-500: #F8A82A;
  --gold-600: #E3900F;
  --gold-700: #94590A; /* accessible gold for text on light backgrounds */
  --gold-800: #6B4105;

  --ink-900: #1C1917;
  --ink-800: #2A2521;
  --ink-700: #3B3530;
  --ink-600: #554D46;
  --ink-500: #6F665E;

  --paper: #FFFDF9;
  --surface: #FFFFFF;
  --line: #ECE3D4;
  --line-strong: #DCCFBB;

  --danger: #B42318;
  --danger-bg: #FEF3F2;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-tamil: 'Noto Sans Tamil', 'Nirmala UI', 'Latha', sans-serif;
  --font-tamil-display: 'Noto Serif Tamil', 'Noto Sans Tamil', 'Nirmala UI', 'Latha', serif;

  --gutter: clamp(16px, 5vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

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

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

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-900);
  background-color: var(--paper);
  /* Dawn glow behind the masthead, fading into warm paper */
  background-image:
    radial-gradient(ellipse 70% 42% at 50% 0%, rgba(248, 168, 42, .20), rgba(248, 168, 42, 0) 70%),
    linear-gradient(180deg, var(--gold-50) 0%, var(--paper) 55%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

/* Clip the decorative halo so it never causes sideways scrolling */
.bg-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Fine inset frame, like the border of a printed cover */
body::before {
  content: '';
  position: fixed;
  inset: 14px;
  border: 1px solid rgba(148, 89, 10, .16);
  border-radius: 4px;
  pointer-events: none;
  z-index: 0;
}

/* Faint concentric halo — the only ornament on the page */
.bg-clip::after {
  content: '';
  position: absolute;
  top: -380px;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 58px, rgba(148, 89, 10, .06) 58px 59px);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  mask-image: radial-gradient(circle, #000 20%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }

:lang(ta) {
  font-family: var(--font-tamil);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.75;
  word-break: normal;
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 3px solid var(--ink-900);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 10;
  transform: translate(-50%, -120%);
  padding: 10px 18px;
  background: var(--ink-900);
  color: var(--gold-50);
  font-weight: 600;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Layout ----------
 * Phones/tablets: one centred column.
 * Laptops and up (≥960px): logo + message on the left, subscribe card on the
 * right, sized so the whole page fits in one screen without scrolling.
 */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 5vh, 56px) var(--gutter) clamp(14px, 2.5vh, 24px);
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(26px, 4vh, 44px);
}

/* ---------- Hero ---------- */

.hero {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.masthead {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: clamp(18px, 3.4vh, 34px);
}
.masthead__logo { width: 100%; max-width: 640px; }

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, .9rem + 2.6vw, 2.75rem);
  font-weight: 350;
  font-variation-settings: 'opsz' 144;
  letter-spacing: .06em;
  line-height: 1.12;
  text-transform: uppercase;
  color: var(--ink-900);
  text-wrap: balance;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-700);
}

.hero__message {
  position: relative;
  margin-top: clamp(14px, 2.4vh, 24px);
  padding-top: clamp(14px, 2.4vh, 22px);
  max-width: 32em;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  font-size: clamp(1rem, .95rem + .3vw, 1.18rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-800);
  text-wrap: balance;
}
.hero__message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 56px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--gold-500);
  border-radius: 2px;
}
.hero__message :lang(ta) { font-size: .95em; font-weight: 600; line-height: 1.65; color: var(--ink-800); }

/* ---------- Subscribe card ---------- */

.subscribe {
  width: 100%;
  max-width: 460px;
  scroll-margin-top: 16px;
}
.subscribe:focus { outline: none; }

.card {
  position: relative;
  padding: clamp(20px, 3.4vh, 32px) clamp(18px, 4vw, 32px) clamp(18px, 2.8vh, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(28, 25, 23, .04), 0 28px 56px -28px rgba(107, 65, 5, .28);
  text-align: left;
}
.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: 72px;
  height: 3px;
  transform: translateX(-50%);
  background: var(--gold-500);
  border-radius: 0 0 3px 3px;
}

.card__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem);
  font-weight: 450;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.card__title:focus { outline: none; }

.card__intro {
  margin: 8px auto 0;
  max-width: 30em;
  display: grid;
  gap: 2px;
  text-align: center;
  color: var(--ink-600);
  font-size: .95rem;
  line-height: 1.5;
  text-wrap: balance;
}
.card__intro :lang(ta) { font-size: .88rem; color: var(--ink-700); line-height: 1.6; }

/* ---------- Form ---------- */

.form { margin-top: clamp(14px, 2.4vh, 22px); display: grid; gap: clamp(10px, 1.6vh, 14px); }

.field { display: grid; gap: 4px; }
.field label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-900);
}
.label-ta { font-size: .85rem; font-weight: 500; color: var(--ink-600); line-height: 1.5; }
.optional {
  margin-left: auto;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem; /* 16px+ prevents zoom on iOS */
  color: var(--ink-900);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:hover { border-color: #C9B89E; }
.field input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--gold-700);
  box-shadow: 0 0 0 3px var(--gold-200);
}
.field input[aria-invalid='true'] { border-color: var(--danger); background: var(--surface); }
.field input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px #FDD8D3; }

.field__error {
  font-size: .86rem;
  line-height: 1.45;
  color: var(--danger);
}
.field__error:empty { display: none; }
.field__error :lang(ta) { display: block; font-size: .82rem; line-height: 1.55; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  margin-top: 4px;
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-900);
  background: var(--gold-500);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 22px -12px rgba(227, 144, 15, .95);
  transition: background-color .15s, transform .15s var(--ease), box-shadow .15s;
  touch-action: manipulation;
}
.btn:hover { background: var(--gold-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: .8; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(28, 25, 23, .25);
  border-top-color: var(--ink-900);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form__status:empty { display: none; }
.form__status {
  padding: 10px 14px;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #F7C7C1;
  border-radius: 10px;
}
.form__status :lang(ta) { display: block; font-size: .85rem; line-height: 1.55; }

.form__note {
  text-align: center;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--ink-500);
}
.form__note :lang(ta) { display: block; font-size: .78rem; line-height: 1.55; }

/* ---------- Success ---------- */

.success { text-align: center; padding: 8px 0 4px; }
.success__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-100);
  color: var(--gold-800);
}
.success__mark svg { width: 26px; height: 26px; }
.success__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.3rem);
  font-weight: 450;
  line-height: 1.15;
}
.success__title:focus { outline: none; }
.success__title-ta {
  display: block;
  margin-top: 4px;
  font-family: var(--font-tamil-display);
  font-size: .8em;
  font-weight: 700;
  color: var(--gold-700);
  line-height: 1.5;
}
.success__body { margin-top: 14px; display: grid; gap: 8px; color: var(--ink-600); }
.success__body :lang(ta) { font-size: .95rem; color: var(--ink-700); line-height: 1.7; }

/* ---------- Footer ---------- */

.footer {
  padding-top: clamp(16px, 2.6vh, 28px);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--ink-500);
  text-align: center;
}
.footer__tag { color: var(--gold-700); font-weight: 600; }

/* ---------- Phones & tablets: compact stacked rhythm ---------- */

@media (max-width: 959px) {
  .page { padding-top: clamp(20px, 3vh, 32px); }
  .stage { gap: clamp(18px, 2.6vh, 28px); }
  .masthead { margin-bottom: clamp(12px, 2vh, 20px); }
  .masthead__logo { max-width: 520px; }
  .hero__message { margin-top: 12px; padding-top: 14px; }
  .footer { padding-top: 16px; }
}

/* ---------- Laptop & desktop: single-screen, two columns ---------- */

@media (min-width: 960px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
    align-items: center;
    column-gap: clamp(48px, 6vw, 104px);
  }
  .hero { max-width: none; }
  .masthead__logo { max-width: min(640px, 100%); }
  .subscribe { max-width: none; }
}

/* Short laptop screens: tighten the vertical rhythm a little more */
@media (min-width: 960px) and (max-height: 720px) {
  .field input { min-height: 42px; padding: 8px 14px; }
  .btn { min-height: 48px; }
  .card__intro { font-size: .9rem; }
  .form__note :lang(ta) { display: inline; }
}

/* ---------- Gentle entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero, .subscribe {
    animation: rise .9s var(--ease) both;
  }
  .subscribe { animation-delay: .15s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  body { font-size: 1rem; }
  body::before { inset: 8px; }
  .bg-clip::after { width: 640px; height: 640px; top: -300px; }
  .hero__message { font-size: .96rem; gap: 2px; }
  .card { border-radius: 16px; padding: 18px 16px 16px; }
  .card__title { font-size: 1.3rem; }
  .card__intro { margin-top: 6px; font-size: .86rem; line-height: 1.45; }
  .card__intro :lang(ta) { font-size: .8rem; line-height: 1.55; }
  .form { margin-top: 14px; gap: 10px; }
  .field { gap: 2px; }
  .field label { font-size: .86rem; }
  .label-ta { font-size: .8rem; }
  .field input { min-height: 44px; padding: 8px 12px; }
  .btn { min-height: 50px; margin-top: 2px; }
}