/* =========================================================================
   Mayu Okazaki — English-to-Japanese Translator
   v0 stylesheet. Restrained editorial design.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --color-bg: #f7f4ee;          /* warm off-white */
  --color-surface: #f1ede4;     /* slightly deeper panel tone */
  --color-text: #2c2a26;        /* dark charcoal, not pure black */
  --color-text-soft: #55514a;   /* secondary text */
  --color-accent: #9a5b41;      /* muted terracotta, used sparingly */
  --color-rule: #ddd6c8;        /* subtle divider */

  /* Type */
  --font-serif: Georgia, "Times New Roman", "Hiragino Mincho ProN", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;

  /* Layout */
  --measure: 68rem;
  --measure-narrow: 46rem;
  --space-section: clamp(3.5rem, 8vw, 7rem);
}

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

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: inherit;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--color-rule);
}

.section--narrow .container {
  max-width: var(--measure-narrow);
}

.section__heading {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: 0.01em;
  margin-bottom: 1.75rem;
}

/* ---------- Accessibility: skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 4px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* Visible focus for keyboard users everywhere */
a:focus-visible,
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--color-rule);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.site-header__name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-nav__list a {
  text-decoration: none;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav__list a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------- Hero ----------
   Text-only by design. If a portrait is introduced later, add a column here
   rather than reworking the type scale below. */
.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.hero__text {
  max-width: 40rem;
}

.hero__name {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.hero__role {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.hero__focus {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--color-text-soft);
  margin-bottom: 1.5rem;
}

.hero__lede {
  font-size: 1.1rem;
  max-width: 34rem;
  margin-bottom: 0;
}

/* ---------- Selected Work / Featured project (inactive) ----------
   These styles are ready but currently unused: the Selected Work section is
   omitted from index.html until the client approves portfolio display. To
   re-enable, add a <section id="selected-work"> containing a .featured-list.
   Media column left, details right; stacks on narrow screens. Additional
   entries can be appended to .featured-list without restructuring. */
.featured-list {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.featured__media {
  margin: 0;
}

/* Placeholder thumbnail — swap for <img class="featured__thumb"> later.
   Both share the 16:9 box so the layout does not shift. */
.featured__thumb {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  object-fit: cover;
  overflow: hidden;
  /* Dark, restrained, faintly cinematic — a forest at dusk, not a grey box */
  background-image:
    radial-gradient(
      120% 90% at 72% 18%,
      rgba(196, 176, 138, 0.16) 0%,
      rgba(196, 176, 138, 0) 55%
    ),
    linear-gradient(
      165deg,
      #2f3a30 0%,
      #253026 45%,
      #1b231d 100%
    );
}

/* Vignette, kept as a pseudo-element so an <img> swap loses it cleanly */
.featured__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    100% 80% at 50% 45%,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.42) 100%
  );
  pointer-events: none;
}

.featured__thumb-title {
  position: relative;
  z-index: 1;
  padding: 1rem 1.15rem;
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  letter-spacing: 0.03em;
  color: rgba(244, 240, 231, 0.82);
}

/* Decorative play affordance — non-interactive in this preview */
.featured__play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 3.25rem;
  height: 3.25rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(244, 240, 231, 0.55);
  border-radius: 50%;
}

.featured__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 0.42rem 0 0.42rem 0.68rem;
  border-color: transparent transparent transparent rgba(244, 240, 231, 0.75);
}

.featured__status {
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.featured__title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin-bottom: 0.5rem;
}

.featured__meta {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.featured__sep {
  margin-inline: 0.45em;
  opacity: 0.6;
}

.featured__desc {
  color: var(--color-text-soft);
  margin-bottom: 1.1rem;
}

/* Non-functional in this preview; becomes an <a> when a link exists */
.featured__link {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--color-accent);
  cursor: default;
}

/* ---------- What I Translate ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
}

.work-item {
  padding-top: 1.25rem;
  border-top: 2px solid var(--color-accent);
}

.work-item__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.work-item p {
  color: var(--color-text-soft);
  margin-bottom: 0;
}

/* ---------- Prose (Approach / About) ---------- */
.prose {
  max-width: var(--measure-narrow);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose--lead {
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-family: var(--font-serif);
  line-height: 1.6;
  color: var(--color-text);
}

/* ---------- Contact form ---------- */
.contact-form {
  margin-top: 2rem;
  max-width: 34rem;
}

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.req {
  color: var(--color-accent);
}

.optional {
  font-weight: 400;
  color: var(--color-text-soft);
}

.field__help {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--color-text);
  background-color: #fffdf9;
  border: 1px solid var(--color-rule);
  border-radius: 4px;
}

.contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

/* Honeypot — visually and programmatically hidden, still focusable-out */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  font: inherit;
  font-size: 0.98rem;
  color: #ffffff;
  background-color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background-color: #834b34;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  margin: 1.1rem 0 0;
  min-height: 1.3em;
  font-size: 0.95rem;
}

.form-status--pending {
  color: var(--color-text-soft);
}

.form-status--success {
  color: #3f6b4a;
}

.form-status--error {
  color: #a3402f;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-rule);
  padding-block: 2.5rem;
}

.site-footer__text {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 46rem) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  /* Featured project stacks: thumbnail, then status, title, meta, desc, link.
     Source order already matches, so no reordering is needed. */
  .featured {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .featured__play {
    width: 2.75rem;
    height: 2.75rem;
  }
}
