/*
Theme Name: Raster & Root
Theme URI: https://rasterandroot.com
Author: Raster & Root
Author URI: https://rasterandroot.com
Description: A bold, playful one-page theme for a web design studio, built from the Raster & Root brand system — dark ink background, purple/pink/yellow-green accents, animated star field, and a rolling mascot header. Portfolio and Services are manageable custom post types; hero, contact and footer content are editable from the Customizer.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: raster-root
*/

/* ============================
   Fonts
============================ */
@font-face {
  font-family: 'Madky';
  src: url('fonts/Madky.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('fonts/NeueMontreal-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('fonts/NeueMontreal-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('fonts/NeueMontreal-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Montreal';
  src: url('fonts/NeueMontreal-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

/* ============================
   Variables
============================ */
:root{
  --purple-light: #985dc7;
  --blue-dark:    #392989;
  --purple-dark:  #5f278b;
  --pink:         #d431a1;
  --yellow-green: #e9f95b;
  --ink:          #070015;

  --bg:           var(--ink);
  --bg-raised:    #0f0524;
  --text:         #f6f2ff;
  --text-muted:   #c6b8e6;
  --lilac:        #ded4fb; /* brighter than --text-muted; used for small labels/links on dark backgrounds so they never read as "too dark" */

  /* ----------------------------------------------------------------
     Editable brand colors. Defaults here match the current design —
     they're overridden by inc/dynamic-colors.php with whatever is set
     in Appearance > Customize > Brand Colors, so this theme keeps
     working even before anyone opens the Customizer.
  ---------------------------------------------------------------- */
  --btn-primary-bg:         var(--yellow-green);
  --btn-primary-text:       var(--ink);
  --btn-primary-hover-bg:   var(--pink);
  --btn-primary-hover-text: #ffffff;
  --headline-1:             #ffffff;
  --headline-2:             var(--yellow-green);
  --social-color:           #c9a4f0;
  --social-hover:           #ffffff;
  --scroll-color:           #ffffff;
  --footer-copy-color:      #ffffff;

  --font-display: 'Madky', 'Baloo 2', system-ui, sans-serif;
  --font-body:    'Neue Montreal', 'Helvetica Neue', Arial, sans-serif;

  --radius: 22px;
  --wrap: 1180px;
  --ease: cubic-bezier(.22,1,.36,1);
}

/* ============================
   Reset
============================ */
*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3{ margin:0; font-family: var(--font-display); font-weight:400; }
p{ margin:0; }
button, input, textarea, select{ font-family: inherit; }
.wrap{ width:100%; max-width: var(--wrap); margin:0 auto; padding: 0 28px; }
section{ position: relative; scroll-margin-top: 84px; }
::selection{ background: var(--pink); color: var(--ink); }

/* ============================
   Motion respect
============================ */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================
   Buttons & shared bits
============================ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor:pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.btn.btn-primary{
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  border: none !important;
  box-shadow: 0 0 0 0 rgba(233,249,91,0);
}
.btn.btn-primary:hover,
.btn.btn-primary:focus-visible{
  background: var(--btn-primary-hover-bg) !important;
  color: var(--btn-primary-hover-text) !important;
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 14px 30px -10px rgba(212,49,161,.6);
}
.btn-ghost{
  background: transparent;
  border-color: rgba(246,242,255,.35);
  color: var(--text);
}
.btn-ghost:hover{
  border-color: var(--yellow-green);
  color: var(--yellow-green);
  transform: translateY(-3px) rotate(1deg);
}
.btn-sm{ padding: 10px 20px; font-size: .85rem; }
.btn-block{ width:100%; }

.section-tag{
  display:inline-flex; align-items:center; gap:8px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--yellow-green);
  margin-bottom: 18px;
}
.section-tag svg{ fill: var(--pink); flex-shrink:0; }
.section-heading{
  font-size: clamp(2rem, 4.4vw, 3rem);
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: .01em;
}
.section-sub{
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 48px;
}
.section-sub code{
  background: rgba(255,255,255,.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .85em;
}

/* ============================
   Scroll reveal
============================ */
[data-animate]{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-animate].in-view{
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   Ambient background fx
============================ */
#top-fx{
  position: fixed; inset:0;
  pointer-events:none;
  z-index:0;
  background:
    radial-gradient(circle at 15% 20%, rgba(95,39,139,.35), transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(57,41,137,.3), transparent 45%);
}

/* ============================
   Header
============================ */
#site-header{
  position: fixed; top:0; left:0; right:0;
  z-index: 100;
  padding: 18px 0;
  transition: background .35s, padding .35s, box-shadow .35s;
}
#site-header.scrolled{
  background: rgba(7,0,21,.82);
  backdrop-filter: blur(14px);
  padding: 12px 0;
  box-shadow: 0 10px 30px -20px rgba(0,0,0,.6);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between; gap: 20px;
}
.logo{
  display:inline-flex; align-items:center; gap:8px;
  font-size: 1.5rem;
}
.logo-star{ fill: var(--pink); flex-shrink:0; animation: spin-slow 9s linear infinite; }
.logo-word{
  font-family: var(--font-display);
  color: var(--yellow-green);
  letter-spacing: .01em;
  line-height:1;
  padding-top: 4px;
}
#site-nav{ display:flex; align-items:center; gap: 32px; }
#site-nav ul{ display:flex; align-items:center; gap: 32px; }
#site-nav a{
  font-weight: 500;
  font-size: .95rem;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color .25s;
}
#site-nav a::after{
  content:'';
  position:absolute; left:0; bottom:-2px;
  width:0; height:2px;
  background: var(--yellow-green);
  transition: width .3s var(--ease);
}
#site-nav a:hover{ color: var(--text); }
#site-nav a:hover::after{ width:100%; }

.nav-cta{ flex-shrink:0; }
#nav-toggle{
  display:none;
  flex-direction: column; justify-content:center; gap:5px;
  width: 40px; height: 40px;
  background: none; border:none; cursor:pointer;
  padding:0;
}
#nav-toggle span{
  display:block; height:2px; width:100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s;
}

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

/* ============================
   Hero
============================ */
#hero{
  min-height: 100vh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero-blobs{ position:absolute; inset:0; z-index:-1; overflow:hidden; }
.blob{
  position:absolute; border-radius:50%;
  filter: blur(70px);
  opacity:.55;
  animation: float-blob 16s ease-in-out infinite;
}
.blob-a{ width:520px; height:520px; background: var(--purple-dark); top:-160px; left:-160px; }
.blob-b{ width:460px; height:460px; background: var(--pink); bottom:-180px; right:-140px; animation-delay: -4s; }
.blob-c{ width:380px; height:380px; background: var(--blue-dark); top:35%; right:10%; animation-delay: -9s; }
@keyframes float-blob{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(30px,-40px) scale(1.08); }
}

.stars-field{ position:absolute; inset:0; z-index:1; pointer-events:none; }
.floaty-star{ position:absolute; fill: var(--yellow-green); animation: twinkle 4.5s ease-in-out infinite, drift 10s ease-in-out infinite; }
.floaty-star.s1{ top:18%; left:8%; fill: var(--yellow-green); animation-delay: 0s, 0s; }
.floaty-star.s2{ top:65%; left:14%; fill: var(--pink); animation-delay: .6s, 1s; }
.floaty-star.s3{ top:22%; right:10%; fill: var(--purple-light); animation-delay: 1.1s, .4s; }
.floaty-star.s4{ top:72%; right:16%; fill: var(--yellow-green); animation-delay: 1.8s, 1.6s; }
.floaty-star.s5{ top:45%; left:4%; fill: var(--pink); animation-delay: .3s, 2.2s; }
@keyframes twinkle{ 0%,100%{ opacity:.35; transform: scale(.85); } 50%{ opacity:1; transform: scale(1.15); } }
@keyframes drift{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-16px); } }

.hero-inner{ position:relative; z-index:2; text-align:center; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:.85rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color: var(--purple-light);
  margin: 0 0 22px;
}
.eyebrow svg{ fill: var(--pink); }

.hero-headline-row{
  position:relative;
  display:flex; align-items:center; justify-content:center;
  gap: 18px;
  margin-bottom: 26px;
}
.rolling-head{
  width: 132px; height: 198px;
  flex-shrink:0;
  transform: translateX(-160vw) rotate(0deg);
  opacity: 0;
}
.rolling-head canvas, .rolling-head img{ width:100%; height:100%; display:block; filter: drop-shadow(0 14px 20px rgba(0,0,0,.45)); }
.rolling-head.rolling{
  animation: roll-in 1.6s var(--ease) .35s forwards;
}
@keyframes roll-in{
  0%{ transform: translateX(-160vw) rotate(0deg); opacity: 1; }
  65%{ transform: translateX(6px) rotate(760deg); opacity: 1; }
  80%{ transform: translateX(-10px) rotate(730deg); }
  100%{ transform: translateX(0) rotate(720deg); opacity: 1; }
}

.hero-headline{ text-align:left; }
.hero-headline .line{
  display:block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  line-height: 1.02;
  color: var(--text);
}
.hero-headline .line-1{ color: var(--headline-1); }
.hero-headline .line-2{ color: var(--headline-2); }
.headline-dot{ color: var(--pink); }

.hero-sub{
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.hero-ctas{ display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap; }

.scroll-cue{
  position:absolute; bottom:34px; left:50%; transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  font-size:.75rem; letter-spacing:.15em; text-transform:uppercase;
  color: var(--scroll-color);
  text-shadow: 0 1px 8px rgba(7,0,21,.9); /* keeps it legible even where a blurred blob brightens the area behind it */
  animation: bob 2.4s ease-in-out infinite;
}
.scroll-cue svg{ fill: var(--yellow-green); }
@keyframes bob{ 0%,100%{ transform: translate(-50%,0); } 50%{ transform: translate(-50%,8px); } }

@media (max-width: 720px){
  .hero-headline-row{ flex-direction:column; gap:8px; }
  .hero-headline{ text-align:center; }
  .rolling-head{ width:96px; height:144px; }
  @keyframes roll-in{
    0%{ transform: translateX(-160vw) rotate(0deg); opacity: 1; }
    65%{ transform: translateX(0) rotate(760deg); opacity: 1; }
    80%{ transform: translateX(0) rotate(730deg); }
    100%{ transform: translateX(0) rotate(720deg); opacity: 1; }
  }
}

/* ============================
   About
============================ */
#about{ padding: 130px 0 100px; }
.about-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items:start;
}
.about-lead{ font-size: 1.2rem; color: var(--text-muted); }
.about-features{ display:flex; flex-direction:column; gap: 26px; }
.about-features li{ display:flex; gap:16px; align-items:flex-start; }
.about-features svg{ fill: var(--yellow-green); flex-shrink:0; margin-top:4px; }
.about-features h3{ font-family: var(--font-body); font-size: 1.05rem; font-weight:700; margin-bottom:4px; color: var(--text); }
.about-features p{ color: var(--text-muted); font-size: .96rem; }

@media (max-width: 860px){
  .about-grid{ grid-template-columns: 1fr; gap: 36px; }
}

/* ============================
   Services
============================ */
#services{ padding: 100px 0; background: linear-gradient(180deg, transparent, rgba(57,41,137,.14), transparent); }
.services-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.service-card{
  position:relative;
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: transform .4s var(--ease), border-color .4s, background .4s;
}
.service-card:hover{
  transform: translateY(-8px) rotate(-.6deg);
  border-color: rgba(233,249,91,.4);
  background: #140a2c;
}
.card-star{
  position:absolute; top:22px; right:22px;
  fill: var(--pink);
  opacity:.7;
  transition: transform .5s var(--ease);
}
.service-card:hover .card-star{ transform: rotate(90deg) scale(1.2); }
.service-icon{
  width: 56px; height: 56px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 16px;
  background: rgba(152,93,199,.16);
  color: var(--purple-light);
  margin-bottom: 22px;
}
.service-card h3{ font-family: var(--font-body); font-weight:700; font-size:1.15rem; margin-bottom:10px; color: var(--text); }
.service-card p{ color: var(--text-muted); font-size: .92rem; }

@media (max-width: 980px){ .services-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px){ .services-grid{ grid-template-columns: 1fr; } }

/* ============================
   Portfolio
============================ */
#portfolio{ padding: 100px 0; }
.portfolio-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.portfolio-card{
  position:relative;
  border-radius: var(--radius);
  overflow:hidden;
  aspect-ratio: 4/3;
  cursor:default;
  border: 1px solid rgba(255,255,255,.08);
}
.portfolio-thumb{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  transition: transform .5s var(--ease);
  background-size: cover;
  background-position: center;
}
.portfolio-card:hover .portfolio-thumb{ transform: scale(1.06) rotate(-1deg); }
.portfolio-mark{ font-family: var(--font-display); font-size: 2.6rem; color: rgba(7,0,21,.28); }
.portfolio-info{
  position:absolute; inset:auto 0 0 0;
  padding: 20px 22px;
  background: linear-gradient(180deg, transparent, rgba(7,0,21,.82));
  display:flex; align-items:flex-end; justify-content:space-between; gap: 10px;
}
.portfolio-info h3{ font-family: var(--font-body); font-weight:700; font-size:1.05rem; color:#fff; }
.portfolio-tag{
  font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  padding: 5px 11px; border-radius:999px;
  background: rgba(255,255,255,.14); color:#fff;
  white-space:nowrap;
}

@media (max-width: 980px){ .portfolio-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px){ .portfolio-grid{ grid-template-columns: 1fr; } }

/* ============================
   Contact
============================ */
#contact{ padding: 100px 0 130px; }
.contact-inner{
  display:grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 60px;
  align-items:start;
}
.contact-email{
  display:inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--yellow-green);
  margin: 4px 0 30px;
  border-bottom: 2px dashed rgba(233,249,91,.4);
  padding-bottom: 4px;
  transition: color .25s, border-color .25s;
}
.contact-email:hover{ color: var(--pink); border-color: var(--pink); }
.contact-social{ display:flex; flex-direction:column; gap:14px; }
.contact-social a{
  display:inline-flex; align-items:center; gap:10px;
  color: var(--social-color);
  transition: color .25s, transform .25s;
}
.contact-social svg{ fill: var(--purple-light); flex-shrink:0; }
.contact-social a:hover{ color: var(--social-hover); transform: translateX(4px); }

.contact-form{
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 34px;
  display:flex; flex-direction:column; gap: 18px;
}
.form-row{ display:flex; flex-direction:column; gap:8px; }
.form-row label{ font-size:.85rem; font-weight:600; color: var(--text-muted); }
.form-row input, .form-row select, .form-row textarea{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-size: .98rem;
  resize: vertical;
  transition: border-color .25s, background .25s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus{
  outline:none;
  border-color: var(--yellow-green);
  background: rgba(255,255,255,.08);
}
.form-row select{ appearance:none; cursor:pointer; }
.contact-form .btn{ margin-top: 6px; }
.form-status{ font-size:.9rem; min-height: 1.2em; color: var(--yellow-green); }
.form-status.error{ color: var(--pink); }

@media (max-width: 860px){
  .contact-inner{ grid-template-columns: 1fr; gap: 40px; }
}

/* ============================
   Footer
============================ */
#site-footer{
  background: var(--bg-raised);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 50px 0 34px;
}
.footer-inner{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  gap: 16px;
}
.footer-tagline{ font-family: var(--font-display); color: var(--text-muted); font-size: 1rem; }
.footer-social{ display:flex; gap: 28px; margin: 8px 0 4px; flex-wrap:wrap; justify-content:center; }
.footer-social a{
  display:inline-flex; align-items:center; gap:8px;
  color: var(--social-color);
  font-size:.92rem; font-weight:500;
  transition: color .25s, transform .25s;
}
.footer-social svg{ fill: var(--pink); flex-shrink:0; }
.footer-social a:hover{ color: var(--social-hover); transform: translateY(-2px); }
.footer-copy{
  display:flex; align-items:center; gap:8px;
  font-size:.82rem; color: var(--footer-copy-color);
  margin-top: 10px;
}
.footer-copy svg{ fill: var(--purple-light); }

/* ============================
   Generic entry content
   (single posts/pages — the one-pager itself doesn't use this)
============================ */
.entry-wrap{ padding: 160px 0 100px; }
.entry-title{
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin-bottom: 28px;
  color: var(--text);
}
.entry-content{ color: var(--text-muted); max-width: 760px; }
.entry-content p{ margin-bottom: 1.2em; }
.entry-content a{ color: var(--yellow-green); text-decoration: underline; }
.entry-content img{ border-radius: var(--radius); margin: 1.2em 0; }
.entry-content ul, .entry-content ol{ margin: 0 0 1.2em 1.4em; list-style: revert; }

/* ============================
   Mobile nav
============================ */
@media (max-width: 860px){
  #site-nav{
    position:fixed; top:0; right:0; height:100vh; width:min(78vw,320px);
    background: rgba(7,0,21,.97);
    backdrop-filter: blur(10px);
    flex-direction:column; align-items:flex-start; justify-content:center;
    gap: 30px; padding: 0 40px;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    z-index: 99;
  }
  #site-nav.open{ transform: translateX(0); }
  #site-nav ul{ flex-direction:column; align-items:flex-start; gap:30px; }
  #site-nav a{ font-size: 1.3rem; }
  .nav-cta{ display:none; }
  #nav-toggle{ display:flex; z-index: 101; }
  #nav-toggle.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  #nav-toggle.open span:nth-child(2){ opacity:0; }
  #nav-toggle.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
}
