/*
Theme Name: Anita Atelier — Under Construction
Theme URI: https://anitaatelier.com
Author: Anita Atelier
Author URI: https://anitaatelier.com
Description: A premium, editorial "under construction" theme for Anita Atelier, a Portugal-based crochet atelier. Built around the brand's circular monogram and crochet-hook motif, with Playfair Display and Manrope typography, a self-drawing signature ring animation, and a working email waitlist saved directly to WordPress.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: anita-atelier
*/

/* ==========================================================================
   TOKENS
   ========================================================================== */

:root {
  /* Brand colors — from Anita Atelier Identity Manual v1.0 */
  --aa-cream: #F7F1E3;      /* main background */
  --aa-black: #111111;      /* typography / structure */
  --aa-gold: #FFD700;       /* decorative accent — used sparingly */
  --aa-gold-deep: #B8860B;  /* legible gold for small text / on cream */
  --aa-camel: #B8895B;      /* warm secondary accent */
  --aa-sand: #E6D2B5;       /* soft support tone */
  --aa-sage: #6E7B6A;       /* subtle natural accent */
  --aa-white: #FFFFFF;

  --aa-black-soft: rgba(17, 17, 17, 0.72);
  --aa-black-faint: rgba(17, 17, 17, 0.4);
  --aa-hairline: rgba(17, 17, 17, 0.14);
  --aa-gold-hairline: rgba(184, 134, 11, 0.45);

  /* Type */
  --aa-font-display: "Playfair Display", "Georgia", serif;
  --aa-font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --aa-max-width: 640px;
  --aa-gutter: clamp(24px, 6vw, 64px);
  --aa-ring-size: clamp(120px, 22vw, 176px);
}

/* ==========================================================================
   RESET
   ========================================================================== */

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

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

body {
  margin: 0;
  background-color: var(--aa-cream);
  color: var(--aa-black);
  font-family: var(--aa-font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

/* ==========================================================================
   BACKGROUND TEXTURE — subtle linen grain, per brand's material direction
   ========================================================================== */

.aa-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.aa-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--aa-cream);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(184, 137, 91, 0.08), transparent 45%),
    radial-gradient(circle at 85% 78%, rgba(110, 123, 106, 0.07), transparent 45%);
}

.aa-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.07  0 0 0 0 0.07  0 0 0 0 0.07  0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.aa-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(48px, 8vh, 96px) var(--aa-gutter);
}

.aa-container {
  width: 100%;
  max-width: var(--aa-max-width);
  margin: 0 auto;
  text-align: center;
}

/* ==========================================================================
   SIGNATURE MARK — self-drawing ring around the monogram
   The ring traces itself in on load, echoing the brand's own language:
   "the circle suggests continuity, care, and atelier-level completeness."
   ========================================================================== */

.aa-mark {
  position: relative;
  width: var(--aa-ring-size);
  height: var(--aa-ring-size);
  margin: 0 auto clamp(28px, 5vw, 40px);
}

.aa-mark__img {
  position: absolute;
  inset: 20%;
  width: 60%;
  height: 60%;
  object-fit: contain;
  opacity: 0;
  animation: aa-mark-reveal 900ms 900ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.aa-mark__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.aa-mark__ring circle {
  fill: none;
}

.aa-mark__ring-track {
  stroke: rgba(17, 17, 17, 0.08);
  stroke-width: 1;
}

.aa-mark__ring-draw {
  stroke: url(#aa-ring-gradient);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 402;
  stroke-dashoffset: 402;
  animation: aa-ring-draw 1400ms 200ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.aa-mark__ring-stitch {
  stroke: var(--aa-gold-deep);
  stroke-width: 0.75;
  stroke-linecap: round;
  stroke-dasharray: 1 7;
  opacity: 0;
  transform-origin: center;
  animation:
    aa-stitch-fade 600ms 1600ms ease forwards,
    aa-stitch-spin 90s linear infinite;
}

@keyframes aa-ring-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes aa-mark-reveal {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes aa-stitch-fade {
  to { opacity: 1; }
}

@keyframes aa-stitch-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   WORDMARK
   ========================================================================== */

.aa-wordmark {
  margin: 0;
  font-family: var(--aa-font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  letter-spacing: 0.04em;
  color: var(--aa-black);
  opacity: 0;
  animation: aa-rise 800ms 1050ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.aa-wordmark__sub {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--aa-font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--aa-gold-deep);
}

/* ==========================================================================
   DIVIDER — a thin line ending in a hook curl, drawn from the brand's
   own crochet-hook motif
   ========================================================================== */

.aa-divider {
  width: 148px;
  height: 20px;
  margin: clamp(24px, 4vw, 32px) auto;
  opacity: 0;
  animation: aa-rise 700ms 1250ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.aa-divider svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.aa-divider path {
  fill: none;
  stroke: url(#aa-hook-gradient);
  stroke-width: 1.75;
  stroke-linecap: round;
}

/* ==========================================================================
   COPY
   ========================================================================== */

.aa-eyebrow {
  opacity: 0;
  animation: aa-rise 700ms 1350ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  font-family: var(--aa-font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  color: var(--aa-black);
  margin: 0 0 0.85rem;
}

.aa-copy {
  opacity: 0;
  animation: aa-rise 700ms 1450ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  font-size: 0.98rem;
  color: var(--aa-black-soft);
  max-width: 30rem;
  margin: 0 auto;
}

@keyframes aa-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FORM
   ========================================================================== */

.aa-form-wrap {
  opacity: 0;
  animation: aa-rise 700ms 1550ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  margin-top: clamp(28px, 5vw, 40px);
}

.aa-form {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
  border-bottom: 1px solid var(--aa-black);
  transition: border-color 200ms ease;
}

.aa-form:focus-within {
  border-color: var(--aa-gold-deep);
}

.aa-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.aa-form__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 10px 12px 4px;
  font-family: var(--aa-font-body);
  font-size: 0.95rem;
  color: var(--aa-black);
}

.aa-form__input::placeholder {
  color: var(--aa-black-faint);
}

.aa-form__input:focus {
  outline: none;
}

.aa-form__submit {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--aa-black);
  font-family: var(--aa-font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 4px 12px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 200ms ease, gap 200ms ease;
}

.aa-form__submit:hover,
.aa-form__submit:focus-visible {
  color: var(--aa-gold-deep);
  gap: 12px;
}

.aa-form__submit svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.aa-form__note {
  margin: 14px 0 0;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--aa-black-faint);
}

.aa-notice {
  max-width: 420px;
  margin: 0 auto;
  padding: 12px 18px;
  font-size: 0.85rem;
  border: 1px solid var(--aa-hairline);
}

.aa-notice--success {
  color: #3f4b3d;
  background: rgba(110, 123, 106, 0.12);
  border-color: rgba(110, 123, 106, 0.35);
}

.aa-notice--error {
  color: #7a2e22;
  background: rgba(184, 137, 91, 0.12);
  border-color: rgba(184, 137, 91, 0.4);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.aa-footer {
  opacity: 0;
  animation: aa-rise 700ms 1650ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  padding: 0 var(--aa-gutter) clamp(28px, 6vh, 48px);
  text-align: center;
}

.aa-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.aa-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--aa-hairline);
  border-radius: 50%;
  color: var(--aa-black);
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.aa-social a:hover,
.aa-social a:focus-visible {
  border-color: var(--aa-gold-deep);
  color: var(--aa-gold-deep);
  transform: translateY(-2px);
}

.aa-social svg {
  width: 14px;
  height: 14px;
}

.aa-footer__meta {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--aa-black-faint);
}

.aa-footer__meta span {
  margin: 0 6px;
  color: var(--aa-hairline);
}

/* ==========================================================================
   FOCUS STATES — accessibility floor
   ========================================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--aa-gold-deep);
  outline-offset: 3px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
  .aa-form {
    flex-direction: column;
    border-bottom: none;
    gap: 12px;
  }
  .aa-form__input {
    border-bottom: 1px solid var(--aa-black);
    padding: 10px 4px;
  }
  .aa-form__submit {
    justify-content: center;
    border: 1px solid var(--aa-black);
    padding: 12px;
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .aa-mark__img,
  .aa-mark__ring-draw,
  .aa-mark__ring-stitch,
  .aa-wordmark,
  .aa-divider,
  .aa-eyebrow,
  .aa-copy,
  .aa-form-wrap,
  .aa-footer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}
