/* ==========================================================
   JAPZ PORTFOLIO - style.css
   Tip: change colors and fonts in the :root block below.
   ========================================================== */

:root {
  --charcoal: #1e2022;        /* main dark */
  --charcoal-soft: #2b2e31;
  --off-white: #f6f5f2;       /* light background */
  --white: #ffffff;
  --text: #24272a;
  --muted: #5d6368;
  --line: #e2e0da;
  --accent: #2b6b78;          /* subtle teal accent (button on light) */
  --accent-light: #8fc7d1;    /* accent used on dark backgrounds */

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.container { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--charcoal); color: var(--white); padding: .6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: 600 .98rem/1 var(--font-body);
  text-decoration: none;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--charcoal); color: var(--white); }
.btn-primary:hover { background: var(--charcoal-soft); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: #245a66; }
.btn-outline { border-color: var(--charcoal); color: var(--charcoal); background: transparent; }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }
.btn-small { padding: .7rem 1.2rem; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: var(--font-head); font-weight: 800; font-size: 1.5rem;
  letter-spacing: .06em; text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.8rem; }
.site-nav ul a {
  text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--muted);
  padding: .4rem 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.site-nav ul a:hover, .site-nav ul a.active { color: var(--charcoal); border-color: var(--accent); }
.nav-cta { padding: .75rem 1.3rem; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--charcoal); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Image placeholders ----------
   Every .img-slot shows a neutral placeholder until the real image loads.
   If the image file is missing, script.js adds .is-missing. */
.img-slot {
  position: relative; margin: 0; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(30,32,34,.04) 14px 15px),
    #e9e7e1;
  border-radius: var(--radius);
}
.img-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-slot::after {
  content: attr(data-label);
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 .95rem var(--font-body); color: var(--muted); text-align: center; padding: 1rem;
  opacity: 0; pointer-events: none;
}
.img-slot.is-missing::after { opacity: 1; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0; background: var(--off-white); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero-hello { font-weight: 600; letter-spacing: .12em; font-size: .9rem; color: var(--accent); margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; margin-bottom: 1.5rem; }
.hero-desc { font-size: 1.2rem; color: var(--muted); max-width: 34rem; margin-bottom: 2rem; }
.photo-hero { aspect-ratio: 4 / 5; border-radius: 24px 24px 24px 120px; max-width: 460px; justify-self: end; width: 100%; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-light { background: var(--off-white); }
.section-head { margin-bottom: 3rem; }
.section h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }

/* About */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.photo-about { aspect-ratio: 4 / 5; max-width: 440px; width: 100%; }
.about-text h2 { margin-bottom: 1.4rem; }
.about-text p { color: var(--muted); max-width: 36rem; }
.check-list { margin: 0 0 2rem; display: grid; gap: .55rem; }
.check-list li { position: relative; padding-left: 1.9rem; font-weight: 500; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 1rem; height: .55rem;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg) translateY(-30%);
}

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.service {
  padding: 1.8rem; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.service .icon {
  width: 52px; height: 52px; border-radius: 12px; margin-bottom: 1.4rem;
  display: grid; place-items: center; background: var(--charcoal);
}
.service .icon svg {
  width: 26px; height: 26px; fill: none; stroke: var(--accent-light);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.service h3 { font-size: 1.25rem; margin-bottom: .7rem; }
.service p { color: var(--muted); font-size: .98rem; margin: 0; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.project-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .25s, transform .25s;
}
.project-card:hover { box-shadow: 0 18px 40px -22px rgba(30,32,34,.35); transform: translateY(-4px); }
.project-media { aspect-ratio: 16 / 11; border-radius: 0; }
.project-media img { transition: transform .5s; }
.project-card:hover .project-media img { transform: scale(1.03); }
.project-body { padding: 1.6rem; display: flex; flex-direction: column; flex: 1; }
.project-num { font-weight: 600; font-size: .9rem; color: var(--accent); margin-bottom: .5rem; }
.project-body h3 { font-size: 1.4rem; margin-bottom: .7rem; }
.project-body p { color: var(--muted); font-size: .98rem; flex: 1; }
.project-body .btn { align-self: flex-start; margin-top: .5rem; }

/* Contact */
.contact { background: var(--charcoal); color: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact h2 { margin-bottom: 1.2rem; }
.contact-info > p { color: #c4c7ca; max-width: 30rem; margin-bottom: 2.2rem; }
.contact-links { display: grid; gap: 1.2rem; }
.contact-links li { display: grid; gap: .15rem; padding-bottom: 1.2rem; border-bottom: 1px solid rgba(255,255,255,.14); }
.contact-links span { font-size: .9rem; color: #a9adb1; }
.contact-links a { color: var(--accent-light); font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.contact-links a:hover { color: var(--white); }

.contact-form { background: var(--white); color: var(--text); padding: clamp(1.5rem, 4vw, 2.4rem); border-radius: var(--radius); }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: .85rem 1rem; background: var(--off-white);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--white); }
.field.has-error input, .field.has-error textarea { border-color: #b3261e; }
.field textarea { resize: vertical; min-height: 130px; }
.form-status { margin: 1rem 0 0; font-size: .95rem; min-height: 1.4em; }
.form-status.error { color: #b3261e; }
.form-status.ok { color: #1f6b3a; }

/* Footer */
.site-footer { background: #151617; color: #c4c7ca; padding-top: 3rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding-bottom: 2rem; }
.footer-brand .logo { color: var(--white); }
.footer-brand p { margin: .3rem 0 0; font-size: .95rem; }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-footer nav a { text-decoration: none; font-size: .95rem; }
.site-footer nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { border-top: 1px solid rgba(255,255,255,.1); padding: 1.3rem 0; font-size: .9rem; }
.footer-copy p { margin: 0; }

/* One subtle entrance for the hero on page load */
@media (prefers-reduced-motion: no-preference) {
  .hero-text, .photo-hero { animation: rise .8s ease both; }
  .photo-hero { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 1.2rem;
    padding: 1.5rem 1.25rem 2rem; background: var(--white);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: .3rem; }
  .site-nav ul a { display: block; padding: .7rem 0; font-size: 1.1rem; }
  .nav-cta { text-align: center; }

  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .photo-hero { justify-self: start; max-width: 380px; order: -1; }
  .photo-about { max-width: 380px; }
}

@media (max-width: 620px) {
  .services-grid, .projects-grid { grid-template-columns: 1fr; }
  .btn-row .btn { flex: 1 1 100%; text-align: center; }
}
