/* Ale-Studio — exported from the Figma design (Desktop 1280 / Tablet 800 / Mobile 375) */

:root {
  --ink: #000;
  --muted: #646464;
  --line: #e0e0e0;
  --grad: linear-gradient(90deg, #004599 0%, #ff002b 100%);
  --blue: #004599;
  --red: #ff002b;
  --hover: var(--blue);    /* link hover colour — the blue "Explore" shows */
  --sent: #2f9e57;         /* green of the send button (same as the "Thank you" text) */
  --error: #e5484d;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --radius: 2px;
  --shot-ratio: 965 / 585; /* project screenshots */
}

/* Gradient stops as animatable properties, so gradient text can fade to light blue on hover */
@property --g1 { syntax: "<color>"; inherits: false; initial-value: #004599; }
@property --g2 { syntax: "<color>"; inherits: false; initial-value: #ff002b; }

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Rethink Sans", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.grad-text {
  --g1: #004599;
  --g2: #ff002b;
  /* the gradient must span the words only, not the whole column,
     otherwise the red end never shows (e.g. the logo in the sidebar) */
  width: fit-content;
  background: linear-gradient(90deg, var(--g1) 0%, var(--g2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Type styles (from the Figma text styles) ---------- */
.t-h1 { font-size: 37px; line-height: 1.2; letter-spacing: -0.04em; font-weight: 400; }
.t-h2 { font-size: 30px; line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.t-lead { font-family: "Spectral", Georgia, serif; font-size: 40px; line-height: 1.2; letter-spacing: -0.04em; font-weight: 400; }
.t-body { font-size: 15px; line-height: 1.4; letter-spacing: -0.03em; }
.t-link { font-size: 16px; line-height: 1; letter-spacing: -0.03em; }
.t-caption { font-size: 12px; line-height: 1.2; letter-spacing: -0.02em; }

/* ---------- Page shell ---------- */
.site { display: flex; align-items: flex-start; }
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.section { border-top: 1px solid var(--line); padding-right: 20px; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  flex: 0 0 295px; width: 295px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 120px;
  background: #fff;
}
.logo { font-size: 30px; line-height: 1; letter-spacing: -0.04em; font-weight: 500; white-space: nowrap; }
.nav-links { display: flex; flex-direction: column; gap: 60px; }
.nav-pages { display: flex; flex-direction: column; gap: 20px; }
.nav-links a { font-size: 16px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }

/* ---------- Home: "What we do?" ---------- */
.services { display: flex; gap: 16px; padding: 36px 20px 24px 0; }
.services__label { flex: 1 1 0; font-size: 15px; line-height: 1; letter-spacing: -0.04em; }
.services__list { flex: 3 1 0; display: flex; gap: 16px; }
.service { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.service__text { display: flex; flex-direction: column; gap: 10px; }
.service__title { font-size: 15px; line-height: 1; letter-spacing: -0.04em; }
.service__desc { font-family: "Spectral", Georgia, serif; font-style: italic; font-size: 16px; line-height: 1; letter-spacing: -0.04em; }
.service__more { font-size: 12px; line-height: 1.2; letter-spacing: -0.02em; }
.service__more.grad-text { width: auto; } /* as in the design: spans the column, so it reads as blue */

/* ---------- Home: intro + hero ---------- */
.intro { padding-top: 60px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 60px; }
.media { position: relative; overflow: hidden; border-radius: var(--radius); background: #f2f2f2; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--hero { aspect-ratio: 965 / 698; }

/* ---------- Home: featured portfolio ---------- */
.featured {
  padding-top: 60px; padding-bottom: 120px;
  background: linear-gradient(90deg, #fff 31.37%, var(--line) 100%);
}
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.featured__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; margin-top: 60px; }
.feature { display: flex; flex-direction: column; gap: 30px; }
.feature .media { aspect-ratio: 472 / 286; }

.caption { display: flex; flex-direction: column; gap: 4px; }
.caption__title { font-family: "Spectral", Georgia, serif; font-style: italic; font-weight: 500; font-size: 18px; line-height: 1; letter-spacing: -0.05em; }
.caption__sub { font-size: 17px; line-height: 1; letter-spacing: -0.045em; }
.feature:hover .caption__title {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Home: About teaser ---------- */
.about-teaser { padding-top: 60px; padding-bottom: 120px; display: flex; align-items: center; gap: 40px; }
.about-teaser .media { flex: 1 1 0; aspect-ratio: 462.5 / 625; }
.about-teaser .media img { object-position: 12% 50%; }
.about-teaser__copy { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 40px; }

/* ---------- Let's discuss ---------- */
.discuss {
  padding-top: 80px; padding-bottom: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 36px;
  background: linear-gradient(270deg, rgba(224, 224, 224, .45) 8.78%, #fff 92.08%);
}
.discuss__title { text-align: center; }
.discuss__title.grad-text { --g2: #ff012b; }
.discuss__form { display: flex; align-items: center; gap: 16px; }
.discuss__input {
  width: 317px; height: 62px;
  padding: 0 60px;
  border: 2px solid #000; border-radius: 72px;
  background: #fff;
  font-family: inherit; font-size: 17px; font-weight: 500; letter-spacing: -0.045em; line-height: 1.2;
  color: #000; outline: none;
}
.discuss__input::placeholder { color: rgba(0, 0, 0, .22); transition: color .3s; }
.discuss__input:focus-visible { box-shadow: 0 0 0 3px rgba(0, 69, 153, .25); }
/* short messages shown inside the e-mail box */
.discuss__input.is-error { border-color: var(--error); animation: nudge .42s ease; }
.discuss__input.is-error::placeholder { color: var(--error); }
.discuss__input.is-success::placeholder { color: var(--sent); }
.discuss__input { transition: border-color .3s; }

.discuss__send {
  position: relative;
  flex: 0 0 62px; width: 62px; height: 62px;
  border: 2px solid #000; border-radius: 999px; overflow: hidden;
  background: #000;
  transition: background-color .45s ease, border-color .45s ease, transform .2s ease;
}
.discuss__send svg { display: block; width: 100%; height: 100%; transition: opacity .5s ease, transform .6s var(--ease-out); }
.discuss__send:hover { transform: scale(1.04); }
.discuss__send:active { transform: scale(.96); }
.discuss__send.is-sent { background: var(--sent); border-color: var(--sent); }
.discuss__send.is-sent svg { opacity: 0; transform: scale(.5); transition: none; }
.discuss__send[aria-busy="true"] { cursor: default; }

/* small privacy notice under the form */
.discuss__privacy {
  max-width: 395px;           /* same width as the e-mail box + send button */
  margin-top: -16px;          /* 20px below the form instead of the section's 36px gap */
  font-family: "IBM Plex Sans JP", system-ui, sans-serif;
  font-size: 11px; line-height: 1.5; letter-spacing: -0.01em;
  color: var(--muted);        /* #646464 — muted, but still readable (≈5.9:1 on white) */
  text-align: center;
}
.discuss__privacy a { text-decoration: underline; text-underline-offset: 2px; transition: color .3s ease; }
.discuss__privacy a:hover { color: var(--hover); }

/* the paper plane while flying (a copy lifted out of the button) */
.plane-flight { position: fixed; z-index: 1000; margin: 0; pointer-events: none; will-change: transform, opacity; }
.plane-flight path { stroke: #000; }

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------- Footer ---------- */
.footer { padding-top: 60px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 150px; background: #fff; }
.footer__content { display: flex; gap: 40px; }
.footer__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.footer__rows { display: contents; }
.footer .logo { font-size: 30px; }
.f-text { font-family: "IBM Plex Sans JP", system-ui, sans-serif; font-size: 12px; line-height: 1.4; letter-spacing: -0.01em; }
.f-head { font-family: "IBM Plex Sans JP", system-ui, sans-serif; font-size: 13px; line-height: 1.4; letter-spacing: -0.01em; font-weight: 600; }
.footer__links { display: flex; justify-content: space-between; gap: 16px; white-space: nowrap; }
.footer__social, .footer__legal { display: flex; gap: 10px; }
.footer__legal { color: var(--muted); }
.footer__col .f-text { overflow-wrap: anywhere; } /* long e-mail address wraps instead of overlapping */

/* ---------- Hover on text links ---------- */
.nav-pages a,
.footer a, .footer__legal > * {
  transition: color .3s ease;
}
.nav-pages a:hover,
.footer a:hover,
.footer__legal > span:hover { color: var(--hover); }
.footer__legal > span { cursor: default; }
.footer__legal-links { display: flex; align-items: center; gap: 8px; }
.footer__legal-links a[aria-current="page"] { color: var(--ink); }
.footer a:focus-visible,
.nav-pages a:focus-visible,
.legal a:focus-visible,
.discuss__privacy a:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px;
}

/* "What we do?" — title and description fade from black into the blue→red gradient.
   A gradient copy of the text (data-text) sits on top and fades in. */
.service__title, .service__desc {
  position: relative;
  width: fit-content;
  transition: color .35s ease;
}
.service__title::after, .service__desc::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--blue) 0%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.service:hover .service__title,
.service:hover .service__desc,
.service:focus-visible .service__title,
.service:focus-visible .service__desc { color: transparent; }
.service:hover .service__title::after,
.service:hover .service__desc::after,
.service:focus-visible .service__title::after,
.service:focus-visible .service__desc::after { opacity: 1; }

/* ---------- On View: intro + sections ---------- */
.page-intro { padding-top: 60px; display: flex; flex-direction: column; gap: 16px; }
.page-main { display: flex; flex-direction: column; gap: 60px; }
.gap-60 { gap: 60px; }
.projects { padding-top: 60px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 60px; }
.projects--personal { background: linear-gradient(90deg, #fff 50.05%, var(--line) 100%); }

/* Project card (hero + expandable gallery) */
.card { display: flex; flex-direction: column; }
.card > .media { aspect-ratio: var(--shot-ratio); }
.card__more {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease-out;
}
.card.is-open .card__more { grid-template-rows: 1fr; }
.card__more-inner { min-height: 0; overflow: hidden; }
.gallery { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }
.gallery__row { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 20px; }
.gallery .media { aspect-ratio: var(--shot-ratio); }
.card__bar { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.card__bar .caption { flex: 1 1 0; min-width: 0; }
.toggle {
  flex: 0 0 32px; width: 32px; height: 32px;
  border: 1px solid rgba(0, 0, 0, .35); border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .2s, background-color .2s;
}
.toggle svg { width: 12px; height: 12px; transition: transform .3s ease-out; }
.toggle:hover { border-color: #000; }
.card.is-open .toggle svg { transform: rotate(180deg); }
.toggle:focus-visible, .nav-links a:focus-visible, .discuss__send:focus-visible { outline: 2px solid #004599; outline-offset: 3px; }

/* ---------- About ---------- */
.about-hero { padding-right: 20px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 60px; }
.about-hero .page-intro { border-top: 1px solid var(--line); }
.mission { padding-top: 60px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 60px; background: #fff; }
.mission__text { display: flex; flex-direction: column; gap: 1.4em; }
.tech {
  padding-top: 60px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 60px;
  background: linear-gradient(89.96deg, #fff 43.25%, var(--line) 99.97%);
}
.tech__content { display: flex; align-items: flex-start; gap: 20px; }
.tech__info { flex: 0 0 400px; width: 400px; display: flex; flex-direction: column; gap: 60px; }
.tech__row { display: flex; justify-content: space-between; }
.tech__item { width: 190px; display: flex; flex-direction: column; gap: 16px; }
.tech__label { font-size: 12px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 500; color: var(--blue); }
.tech__desc { color: var(--muted); }
.tech .media { flex: 1 1 0; min-width: 0; aspect-ratio: 545 / 567; }
.tech .media img { object-position: 0% 50%; }

/* ---------- Privacy Policy & Accessibility ---------- */
.page-intro .t-caption { color: var(--muted); margin-top: 8px; }
.legal { padding-top: 60px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 60px; background: #fff; }
.legal--tint { background: linear-gradient(89.96deg, #fff 43.25%, var(--line) 99.97%); }
.legal__list { display: flex; flex-direction: column; }
.legal__item {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.legal__item:last-child { padding-bottom: 0; }
.legal__head { display: flex; flex-direction: column; gap: 10px; }
.legal__num { font-size: 12px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 500; color: var(--blue); }
.legal__title { font-size: 17px; line-height: 1.2; letter-spacing: -0.045em; font-weight: 500; }
.legal__body { display: flex; flex-direction: column; gap: 1em; max-width: 620px; }
.legal__body ul { list-style: disc; padding-left: 1.1em; display: flex; flex-direction: column; gap: .45em; }
.legal__body strong { font-weight: 500; }
.legal__body a { text-decoration: underline; text-underline-offset: 2px; transition: color .3s ease; }
.legal__body a:hover { color: var(--hover); }
.legal__body a.legal__mail { display: inline-block; text-decoration: none; overflow-wrap: anywhere; }

@media (max-width: 767px) {
  .legal__item { grid-template-columns: 1fr; gap: 14px; padding: 24px 0; }
}

/* =========================================================
   Tablet (768–1023px) — top bar navigation
   ========================================================= */
@media (max-width: 1023px) {
  .site { display: block; }
  .site-nav {
    width: 100%;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 24px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav .logo { font-size: 26px; }
  .nav-links { flex-direction: row; align-items: center; gap: 24px; }
  .nav-pages { flex-direction: row; gap: 24px; }
  .main { padding-left: 20px; padding-top: 0; }
  .main > :first-child { border-top: 0; }

  .services { padding-top: 24px; }
  .featured__grid { gap: 20px; }
  .footer { padding-left: 20px; gap: 100px; }
  .tech__content { gap: 20px; }
}

/* =========================================================
   Mobile (<768px)
   ========================================================= */
@media (max-width: 767px) {
  .site-nav { padding: 20px 16px; gap: 16px; }
  .site-nav .logo { font-size: 22px; }
  .nav-links, .nav-pages { gap: 16px; }
  .nav-links a { font-size: 15px; }

  /* home: intro comes first, then "What we do?" */
  .home .intro { order: -1; padding-bottom: 40px; }
  .services { flex-direction: column; gap: 24px; padding: 52px 20px 24px 0; }
  .services__list { flex: none; }

  .featured { background: linear-gradient(90deg, #fff 48.08%, var(--line) 100%); }
  .featured__grid { grid-template-columns: 1fr; gap: 21px; }
  .feature .media { aspect-ratio: 335 / 203; }

  .about-teaser { flex-direction: column; align-items: stretch; }
  .about-teaser .media { flex: none; aspect-ratio: 335 / 383; }

  .discuss { padding-left: 2px; padding-right: 22px; }
  .discuss__form { width: 100%; }
  .discuss__input { flex: 1 1 0; width: auto; min-width: 0; padding: 0 28px; }

  .footer { gap: 80px; }
  .footer__content { flex-direction: column; gap: 40px; padding-right: 20px; }
  .footer__rows { display: flex; gap: 16px; }
  .footer__links { flex-direction: column; gap: 16px; padding-right: 20px; }
  .footer__legal { flex-direction: column; gap: 8px; }

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

  .tech__content { flex-direction: column; gap: 40px; }
  .tech__info { flex: none; width: 100%; }
  .tech__item { width: auto; flex: 1 1 0; }
  .tech__row { gap: 20px; }
  .tech .media { flex: none; width: 100%; aspect-ratio: 335 / 348; }
}

/* =========================================================
   Motion — only when JavaScript is running (html.js), so the
   site stays fully visible without it.
   ========================================================= */

/* 1. Page open: whole page fades in, sections rise in one after another */
.js .site-nav { animation: fade-in .7s ease both; }
.js .main > * { animation: rise-in .9s var(--ease-out) both; }
.js .main > :nth-child(1) { animation-delay: .05s; }
.js .main > :nth-child(2) { animation-delay: .15s; }
.js .main > :nth-child(3) { animation-delay: .25s; }
.js .main > :nth-child(n+4) { animation-delay: .35s; }

/* page close: quick fade before going to the next page */
.js.is-leaving .site-nav,
.js.is-leaving .main > * { animation: fade-out .3s ease both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* 2. Images "land": drop in from slightly above and settle */
.js .media.reveal {
  opacity: 0;
  transform: translateY(-26px) scale(1.015);
  transition: opacity .8s ease, transform 1.1s var(--ease-out);
}
.js .media.reveal img { transform: scale(1.08); transition: transform 1.4s var(--ease-out); }
.js .media.reveal.is-in { opacity: 1; transform: none; }
.js .media.reveal.is-in img { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .media.reveal { opacity: 1; transform: none; }
  .js .media.reveal img { transform: none; }
}
