/* =========================================================
   IKI Japanese Kitchen — style.css
   (design/layout unchanged from the original template;
   only the site content was rebranded)
   ========================================================= */

:root {
  --color-bg: #f4f1ec;
  --color-bg-alt: #ede8df;
  --color-ink: #1c1a17;
  --color-ink-soft: #6b6459;
  --color-line: #d8d2c4;
  --color-accent: #7a5230;
  --color-dark: #211a14;
  --color-dark-2: #2a221a;
  --font-base: "Helvetica Neue", "Hiragino Sans", "Yu Gothic", Arial, sans-serif;

  --gap: clamp(1rem, 2vw, 2rem);
  --container-pad: clamp(1.25rem, 4vw, 3rem);
  --dot-size: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p { margin: 0; }

.section-label,
.section-label-plain {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-ink-soft);
  text-transform: none;
}

.text-link,
.cta-link {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), opacity 0.25s var(--ease);
  white-space: nowrap;
}

.text-link:hover,
.cta-link:hover {
  border-color: currentColor;
}

/* corner dots used throughout the grid, mimicking the mockup's intersection marks */
.dot {
  position: absolute;
  width: var(--dot-size);
  height: var(--dot-size);
  background: var(--color-ink);
  border-radius: 1px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 241, 236, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.hide {
  transform: translateY(-100%);
}

/* While the mobile nav drawer is open, neutralise the header's own transform
   so it can't become a containing block for the fixed-position .main-nav panel —
   otherwise the drawer detaches from the viewport if the header hides mid-scroll. */
.site-header.nav-open {
  transform: none;
}

.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-main {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--color-ink-soft);
  margin-top: 2px;
}

/* ---- Hanko (stamp) mark on the kanji, an "iki" nod to a seal-press ---- */
.kanji-stamp {
  display: inline-block;
  color: currentColor;
  transform-origin: 50% 55%;
}

.site-header .kanji-stamp {
  animation: hankoStamp 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

@keyframes hankoStamp {
  0% { transform: scale(2.6) rotate(-14deg); opacity: 0; }
  55% { transform: scale(0.85) rotate(5deg); opacity: 1; }
  75% { transform: scale(1.08) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.85rem;
  position: relative;
  padding-bottom: 2px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-ink);
  transition: width 0.3s var(--ease);
}

.main-nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.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);
}

/* =========================================================
   Layout helpers
   ========================================================= */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--color-line);
  position: relative;
}

/* keep deep-linked sections (e.g. about.html#philosophy) clear of the sticky header */
[id] {
  scroll-margin-top: 100px;
}

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.stagger .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger .reveal:nth-child(2) { transition-delay: 0.15s; }
.stagger .reveal:nth-child(3) { transition-delay: 0.25s; }
.stagger .reveal:nth-child(4) { transition-delay: 0.35s; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: 90px 1fr 1.3fr;
  gap: var(--gap);
  align-items: center;
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.hero-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.55;
  transform: scale(0.95);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.thumb:hover,
.thumb.active {
  opacity: 1;
  transform: scale(1);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.22;
}

.hero-copy .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.line-strong { color: var(--color-ink); }
.line-soft { color: #cfc9bb; }

.hero-copy .line span {
  display: inline-block;
  animation: lineUp 0.9s var(--ease) both;
}

.hero-copy .line:nth-child(1) span { animation-delay: 0.1s; }
.hero-copy .line:nth-child(2) span { animation-delay: 0.2s; }
.hero-copy .line:nth-child(3) span { animation-delay: 0.3s; }
.hero-copy .line:nth-child(4) span { animation-delay: 0.4s; }

@keyframes lineUp {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hero-image {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  align-self: start;
  height: clamp(320px, 36vw, 540px);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.hero-image:hover img {
  transform: scale(1.04);
}

/* Slow continuous drift used on touch viewports in place of the desktop :hover zoom
   (defined globally, only ever triggered from the tablet/mobile media queries below). */
@keyframes heroKenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-1.5%, -1%); }
}

/* ---- Shoji-screen slide reveal on first load ---- */
.shoji-reveal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  pointer-events: none;
}

.shoji-reveal span {
  flex: 1;
  background: var(--color-bg);
  border-left: 1px solid rgba(28, 26, 23, 0.06);
  transform: translateY(0);
  animation: shojiSlide 0.85s var(--ease) forwards;
}

.shoji-reveal span:first-child { border-left: none; }
.shoji-reveal span:nth-child(1) { animation-delay: 0.15s; }
.shoji-reveal span:nth-child(2) { animation-delay: 0.24s; }
.shoji-reveal span:nth-child(3) { animation-delay: 0.33s; }
.shoji-reveal span:nth-child(4) { animation-delay: 0.42s; }
.shoji-reveal span:nth-child(5) { animation-delay: 0.51s; }

@keyframes shojiSlide {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .shoji-reveal { display: none; }
}

.badge-row {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}

.badge {
  background: rgba(20, 16, 12, 0.75);
  color: #f4f1ec;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  backdrop-filter: blur(4px);
}

/* =========================================================
   About
   ========================================================= */
.about {
  display: grid;
  grid-template-columns: 0.6fr 1fr 1.4fr;
  gap: var(--gap);
  align-items: start;
}

.about-image img {
  border-radius: 4px;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s var(--ease), transform 0.5s var(--ease);
}

.about-image:hover img {
  filter: grayscale(0.2) contrast(1.05);
  transform: translateY(-4px);
}

.about-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.about-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.about-content p {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  max-width: 46ch;
  margin-bottom: 2rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 0;
  border-top: 1px solid var(--color-line);
  padding-top: 1.5rem;
}

.stat dt {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat dd {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  line-height: 1.4;
}

/* count-up target style */
.stat dt[data-counted] { color: var(--color-accent); }

/* =========================================================
   Our Craftsmen (about.html team section)
   ========================================================= */
.team-section {
  /* uses the same section spacing/border as the rest of the page */
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.team-card {
  display: flex;
  flex-direction: column;
}

.team-photo {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 3 / 4;
  margin-bottom: 1.25rem;
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s var(--ease), transform 0.6s var(--ease);
}

.team-card:hover .team-photo img {
  filter: grayscale(0.15) contrast(1.05);
  transform: scale(1.05);
}

.team-name {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.team-role {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.team-bio {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  line-height: 1.55;
}

/* =========================================================
   Projects
   ========================================================= */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.project-feature {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.project-feature img {
  width: 100%;
  height: clamp(280px, 45vw, 520px);
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.project-feature:hover img {
  transform: scale(1.03);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.project-card {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}

.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-card:hover img {
  transform: scale(1.08);
}

.project-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 0.6rem;
  font-size: 0.82rem;
}

.proj-title { font-weight: 600; }
.proj-loc { color: var(--color-ink-soft); font-size: 0.75rem; }

/* =========================================================
   Approach
   ========================================================= */
.approach {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gap);
  align-items: center;
  border-bottom: none;
}

.approach > .section-header {
  grid-column: 1 / -1;
}

.approach-image img {
  border-radius: 4px;
  transition: transform 0.6s var(--ease);
}

.approach-image:hover img {
  transform: rotate(-1deg) scale(1.02);
}

.approach-content h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.approach-content p {
  color: var(--color-ink-soft);
  max-width: 50ch;
  margin-bottom: 1.5rem;
}

.approach-content hr {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: 0 0 1.5rem;
}

.cta-link {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-link .arrow {
  display: inline-block;
  animation: arrowDrift 1.8s ease-in-out infinite;
}

.cta-link:hover .arrow {
  animation-play-state: paused;
  transform: translateX(6px);
}

@keyframes arrowDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* full-width span for grid sections spanning 3-col templates */
.hero > *:nth-child(1),
.about > *:nth-child(1) {
  align-self: stretch;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--color-dark);
  color: #cfc7b8;
  margin-top: 0;
}

.footer-top {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--container-pad) 2.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
  gap: 2rem;
}

.footer-brand .logo-main { color: #f4f1ec; }
.footer-brand .logo-sub { color: #9c9384; }

.footer-brand p {
  margin: 1rem 0 1.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #a99f8e;
}

/* ---- Social icons: no background/border container, just the mark ---- */
.socials {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  opacity: 0.8;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.socials a img {
  width: 18px;
  height: 18px;
  display: block;
}

.socials a:hover {
  background: none;
  border: none;
  opacity: 1;
  transform: translateY(-3px);
}

.footer-col h3 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #8f8574;
  margin-bottom: 1.1rem;
  font-weight: 700;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.footer-col a {
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.footer-col a:hover {
  color: #f4f1ec;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid #3a3226;
  padding: 1.25rem var(--container-pad);
  text-align: center;
  font-size: 0.75rem;
  color: #7d7464;
}

/* =========================================================
   Active nav state (for multi-page navigation)
   ========================================================= */
.main-nav a.active {
  color: var(--color-ink);
}

.main-nav a.active::after {
  width: 100%;
}

/* =========================================================
   Page banner (interior pages: Menu / About / Contact)
   ========================================================= */
.page-banner {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  height: clamp(220px, 30vw, 380px);
  display: flex;
  align-items: flex-end;
}

.page-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0) 35%, rgba(20, 16, 12, 0.65) 100%);
}

.page-banner-content {
  position: relative;
  z-index: 2;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  color: #f4f1ec;
}

.page-banner-content .section-label-plain {
  color: #e8ddcf;
}

.page-banner-content h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: #ffffff;
  margin-top: 0.4rem;
}

/* =========================================================
   Menu listing (menu.html)
   ========================================================= */
.menu-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.menu-jump a {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 2px;
  color: var(--color-ink-soft);
  transition: color 0.25s var(--ease);
}

.menu-jump a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-ink);
  transition: width 0.3s var(--ease);
}

.menu-jump a:hover {
  color: var(--color-ink);
}

.menu-jump a:hover::after {
  width: 100%;
}

.menu-section {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--color-line);
  scroll-margin-top: 100px;
}

.menu-section:last-of-type {
  border-bottom: none;
}

.menu-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 3rem;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--color-line);
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.menu-item-desc {
  color: var(--color-ink-soft);
  font-size: 0.8rem;
  max-width: 34ch;
  line-height: 1.4;
}

.menu-item-price {
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
  font-size: 0.9rem;
}

/* =========================================================
   Contact page (contact.html)
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.contact-grid .section-label-plain {
  display: block;
  margin-bottom: 1.5rem;
}

.contact-form {
  display: grid;
  gap: 1.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: none;
  border-bottom: 1px solid var(--color-line);
  background: transparent;
  padding: 0.6rem 0.1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-ink);
  transition: border-color 0.25s var(--ease);
}

.form-field textarea {
  resize: vertical;
  min-height: 90px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-ink);
}

.form-submit {
  justify-self: start;
  margin-top: 0.5rem;
  background: var(--color-dark);
  color: #f4f1ec;
  border: none;
  padding: 0.9rem 2.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.form-submit:hover {
  background: #000;
  transform: translateY(-2px);
}

.form-success {
  display: none;
  margin-top: 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-line);
  border-radius: 4px;
  background: var(--color-bg-alt);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
}

.form-success.show {
  display: block;
  animation: fadeInUp 0.5s var(--ease) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contact-info-item h3 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-ink-soft);
  margin-bottom: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-info-item p,
.contact-info-item address {
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-info-item a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}

.contact-info-item a:hover {
  border-color: currentColor;
}

.map-embed {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  aspect-ratio: 16 / 9;
  margin-top: 0.5rem;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(15%) contrast(1.03);
}

/* =========================================================
   Menu page closer (allergen note + CTA)
   ========================================================= */
.menu-closer {
  border-bottom: none;
  text-align: center;
}

.menu-closer > div {
  max-width: 640px;
  margin: 0 auto;
}

.menu-closer p {
  color: var(--color-ink-soft);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.menu-closer .cta-link {
  justify-content: center;
}

/* =========================================================
   Back to top
   ========================================================= */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-dark);
  color: #f4f1ec;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 90;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/* =========================================================
   Responsive — Tablet (≤ 1024px)
   ========================================================= */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "image"
      "thumbs";
    gap: 1.5rem;
  }
  .hero-copy { grid-area: copy; }
  .hero-image {
    grid-area: image;
    height: clamp(260px, 55vw, 420px);
    border-radius: 10px;
    box-shadow: 0 24px 50px -12px rgba(20, 16, 12, 0.35);
  }
  .hero-thumbs {
    grid-area: thumbs;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.75rem;
  }
  .thumb {
    min-width: 92px;
  }

  /* touch devices never trigger :hover, so give the hero a slow, continuous
     drift instead — a bit of movement in place of the desktop hover zoom */
  .hero-image img {
    animation: heroKenBurns 15s var(--ease) infinite alternate;
  }

  .hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(20, 16, 12, 0) 45%, rgba(20, 16, 12, 0.55) 100%);
  }

  .thumb.active {
    box-shadow: 0 0 0 2px var(--color-ink);
  }

  .about {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label label"
      "image content";
  }
  .about > .section-label { grid-area: label; }
  .about-image { grid-area: image; }
  .about-content { grid-area: content; }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .approach {
    grid-template-columns: 1fr 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Responsive — Mobile (≤ 700px)
   ========================================================= */
@media (max-width: 700px) {
  .header-inner {
    padding: 0.85rem var(--container-pad);
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 320px;
    max-width: 82%;
    background: var(--color-bg);
    box-shadow: -8px 0 24px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    padding: 6rem 2rem 2rem;
    z-index: 99;
    box-sizing: border-box;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }

  .main-nav a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "image"
      "thumbs";
    gap: 1.25rem;
  }

  .hero-image {
    height: clamp(240px, 68vw, 380px);
    border-radius: 14px;
    box-shadow: 0 20px 40px -10px rgba(20, 16, 12, 0.4);
  }

  .badge {
    font-size: 0.68rem;
    padding: 0.4rem 0.75rem;
  }

  .hero-copy .text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
  }

  .hero-copy .text-link::after {
    content: "→";
    display: inline-block;
    animation: arrowDrift 1.8s ease-in-out infinite;
  }

  .hero-thumbs {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
  }

  .thumb {
    min-width: 64px;
    border-radius: 6px;
  }

  .about {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "image"
      "content";
  }

  .about-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .section-header {
    flex-direction: row;
    align-items: center;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .approach {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
  }

  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 40px;
    height: 40px;
  }

  .menu-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .page-banner-content h1 {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }
}

@media (max-width: 420px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
