/* Coastal Code Studio */

/* Self-hosted fonts (SIL Open Font License, see assets/fonts/LICENSE-*.txt) */
@font-face { font-family: "Syne"; src: url("../fonts/syne.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --navy: #0b1d2e;
  --navy-2: #102a40;
  --navy-3: #173a57;
  --teal: #14b8a6;
  --teal-2: #5eead4;
  --sand: #f4e6c8;
  --sand-2: #fbf5e9;
  --coral: #ff7a59;
  --ink: #0b1d2e;
  --text: #33475b;
  --muted: #8aa0b4;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 18px 40px -18px rgba(11, 29, 46, .35);
  --display: "Syne", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--body); color: var(--text); background: var(--sand-2); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.1; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }
.container { width: min(1160px, 92%); margin-inline: auto; }

/* Buttons */
.btn { display: inline-block; background: var(--coral); color: var(--white); font-weight: 700; padding: .9em 1.6em; border-radius: 999px; text-decoration: none; border: 2px solid var(--coral); cursor: pointer; font: inherit; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px var(--coral); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--teal-2); box-shadow: none; }
.btn-small { padding: .55em 1.1em; font-size: .92rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 29, 46, .92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.06); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--white); font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.brand b { color: var(--teal-2); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: #cfdbe6; text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:not(.btn):hover { color: var(--teal-2); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--white); margin: 6px 0; transition: transform .2s; }

/* Hero */
.hero { background: radial-gradient(1200px 600px at 85% -10%, var(--navy-3), transparent 60%), var(--navy); color: #cfdbe6; padding: clamp(4rem, 9vw, 7rem) 0 0; overflow: hidden; }
.hero h1 { color: var(--white); }
.accent { color: var(--teal-2); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: end; }
.hero-copy { padding-bottom: 5rem; }
.eyebrow { color: var(--teal); font-size: .85rem; letter-spacing: .04em; margin-bottom: 1rem; }
.lead { font-size: 1.15rem; max-width: 34ch; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 2.5rem; }
.hero-stats { display: flex; gap: 2.2rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; border-left: 2px solid var(--teal); padding-left: .8rem; }
.hero-stats strong { color: var(--white); font-family: var(--display); font-size: 1.1rem; }
.hero-stats span { font-size: .85rem; color: var(--muted); }

.hero-art { position: relative; min-height: 420px; }
.window { position: relative; z-index: 2; background: #0d2438; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); margin: 0 0 120px auto; max-width: 440px; transform: rotate(-2deg); }
.window-bar { display: flex; align-items: center; gap: 6px; padding: .7rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { margin-left: auto; font-size: .75rem; color: var(--muted); }
.code { margin: 0; padding: 1.2rem 1.4rem 1.5rem; font-size: .88rem; color: #dbe7f1; line-height: 1.7; white-space: pre; overflow-x: auto; }
.code .k { color: var(--coral); } .code .f { color: var(--teal-2); } .code .s { color: var(--sand); } .code .c { color: var(--muted); font-style: italic; }
.pixel-sun { position: absolute; z-index: 1; width: 150px; height: 150px; right: 62%; bottom: 120px; background: var(--coral); clip-path: polygon(30% 0,70% 0,70% 10%,90% 10%,90% 30%,100% 30%,100% 70%,90% 70%,90% 90%,70% 90%,70% 100%,30% 100%,30% 90%,10% 90%,10% 70%,0 70%,0 30%,10% 30%,10% 10%,30% 10%); opacity: .9; animation: bob 6s ease-in-out infinite; }
.hero-waves { position: absolute; z-index: 3; left: -20%; right: -20%; bottom: 0; width: 140%; height: 160px; }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* Sections */
.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-dark { background: var(--navy); color: #cfdbe6; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-sand { background: var(--sand); }

/* Service cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; }
.card { background: var(--white); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); border-top: 4px solid var(--teal); transition: transform .2s; }
.card:hover { transform: translateY(-4px); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(20,184,166,.12); display: grid; place-items: center; margin-bottom: 1.1rem; }
.card-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ticks { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.ticks li { padding-left: 1.4rem; position: relative; margin-bottom: .35rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; background: var(--coral); }

/* Work */
.work-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.4rem; }
.work { background: var(--navy-2); border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; }
.work-thumb { position: relative; height: 200px; }
.work-feature .work-thumb { height: 260px; }
.thumb-splice { background: linear-gradient(160deg, #2dd4bf 0%, #0e7490 55%, #1e1b4b 100%); }
.thumb-web { background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 28px), linear-gradient(140deg, var(--coral), #b91c5c); }
.thumb-biz { background: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 12px, transparent 12px 24px), var(--navy-3); }
.tag { position: absolute; top: 1rem; left: 1rem; background: rgba(11,29,46,.75); color: var(--teal-2); font-size: .72rem; padding: .3em .7em; border-radius: 6px; }
.creature { position: absolute; left: 50%; top: 55%; width: 96px; height: 96px; transform: translate(-50%, -50%); background: var(--sand); clip-path: polygon(20% 10%,35% 10%,35% 25%,65% 25%,65% 10%,80% 10%,80% 30%,95% 30%,95% 80%,80% 80%,80% 95%,20% 95%,20% 80%,5% 80%,5% 30%,20% 30%); animation: bob 4s ease-in-out infinite; }
.creature::after { content: ""; position: absolute; inset: 45% 30% 40% 30%; background: linear-gradient(90deg, var(--navy) 0 25%, transparent 25% 75%, var(--navy) 75%); }
.work-body { padding: 1.5rem 1.6rem 1.8rem; }
.work-type { font-size: .75rem; color: var(--teal); margin-bottom: .4rem; }
.work-body p:last-child { margin: 0; }
.work-body a { color: var(--teal-2); font-weight: 600; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: s; }
.steps li { position: relative; padding-top: 1.2rem; border-top: 2px dashed rgba(11,29,46,.18); }
.step-num { display: inline-block; background: var(--navy); color: var(--teal-2); font-size: .8rem; padding: .3em .6em; border-radius: 6px; margin-bottom: .9rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3.5rem; align-items: center; }
.about-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.about-list li { background: var(--white); border-radius: var(--radius); padding: 1.3rem 1.5rem; display: flex; flex-direction: column; box-shadow: var(--shadow); border-left: 4px solid var(--coral); }
.about-list strong { font-family: var(--display); color: var(--ink); font-size: 1.05rem; }
.about-list span { font-size: .93rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3.5rem; align-items: start; }
.contact-details { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.contact-details li { display: flex; flex-direction: column; }
.contact-details span { font-size: .75rem; color: var(--teal); }
.contact-details a { color: var(--white); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.contact-details a:hover { color: var(--teal-2); }
.contact-form { background: var(--navy-2); padding: 2rem; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.06); display: grid; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label { display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; font-weight: 600; color: #cfdbe6; }
.contact-form em { color: var(--muted); font-weight: 400; }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; font-weight: 500; color: var(--white); background: var(--navy); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: .75em .9em; transition: border-color .15s; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--teal); }
.contact-form textarea { resize: vertical; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute !important; left: -9999px; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: var(--teal-2); }
.form-status.err { color: var(--coral); }

/* Footer */
.site-footer { background: #07141f; color: var(--muted); padding: 2rem 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner a:not(.brand) { color: #cfdbe6; }

/* Reveal on scroll (only hides content once JS has loaded, so no-JS visitors still see it) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* 404 + form-result pages */
.page-message { background: var(--navy); color: #cfdbe6; min-height: 100vh; display: grid; place-items: center; text-align: center; margin: 0; }
.page-message h1 { color: var(--white); }
.page-message .back { margin-top: 2rem; }
.big-404 { font-size: clamp(4rem, 14vw, 9rem); margin: 0; }
.big-404 span { color: var(--coral); }

/* Keyboard focus */
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pixel-sun, .creature { animation: none; }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 1rem; }
  .hero-art { min-height: 360px; }
  .window { margin: 0 auto 120px; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .work-feature { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--navy); padding: .5rem 4% 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); display: none; }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; padding: .7rem 0; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .work-grid, .steps, .field-row { grid-template-columns: 1fr; }
  .pixel-sun { width: 100px; height: 100px; right: 70%; }
}
