/* sailing.ryukyu — night sea / paper / one sun. Pages are generated by build.py. */
@view-transition { navigation: auto; }

:root {
  --ink: #0b1520;
  --ink-2: #122130;
  --ink-line: rgba(243, 240, 234, .14);
  --paper: #f3f0ea;
  --paper-2: #e9e4da;
  --line: rgba(11, 21, 32, .14);
  --mute: #5e6a74;
  --on-ink: #f3f0ea;
  --on-ink-mute: #9aa7b2;
  --sun: #e5a95d;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Geist", "Zen Kaku Gothic New", system-ui, sans-serif;
  --ja: "Zen Kaku Gothic New", "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --gut: clamp(16px, 4vw, 56px);
  --head: 72px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--head); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.9 var(--ja);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
address { font-style: normal; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

.mono {
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 300; }
.lead { font-size: clamp(16px, 1.25vw + 11px, 19px); line-height: 2.05; text-wrap: pretty; max-width: 38em; }

.arr { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; transition: transform .4s var(--ease); }

/* text link with an underline that draws in */
.link {
  display: inline-flex; align-items: center; gap: .6em;
  margin-top: 32px; padding-bottom: 6px;
  font: 500 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.link:hover { background-size: 30% 1px; }
.link:hover .arr { transform: translateX(4px); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gut);
  background: var(--ink);
  border-bottom: 1px solid var(--ink-line);
  color: var(--on-ink);
}
.site-logo img { height: 34px; width: auto; }
#nav:not(:popover-open) { display: block; position: static; inset: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; width: auto; height: auto; overflow: visible; }
#nav ul { display: flex; gap: clamp(18px, 2.4vw, 40px); }
#nav a { display: grid; line-height: 1.35; position: relative; }
#nav .en { font: 450 13.5px/1.3 var(--sans); letter-spacing: .02em; }
#nav .ja { font-size: 10.5px; color: var(--on-ink-mute); letter-spacing: .06em; }
#nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 1px;
  background: var(--sun); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
#nav a:hover::after, #nav a[aria-current=page]::after { transform: scaleX(1); }
.nav-btn, .nav-close { display: none; }

@media (max-width: 860px) {
  .site-head { --head: 64px; }
  .site-logo img { height: 28px; }
  #nav:not(:popover-open) { display: none; }
  .nav-btn {
    display: grid; place-content: center; gap: 7px;
    width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 2;
  }
  .nav-btn span { display: block; width: 24px; height: 1.5px; background: var(--on-ink); transition: transform .35s var(--ease); }
  #nav:popover-open {
    position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
    border: 0; padding: calc(var(--head) + 24px) var(--gut) 40px;
    background: var(--ink); color: var(--on-ink);
    display: flex; flex-direction: column;
  }
  #nav:popover-open ul { flex-direction: column; gap: 0; }
  #nav:popover-open li { border-bottom: 1px solid var(--ink-line); }
  #nav:popover-open a { padding: 18px 0; grid-template-columns: 1fr auto; align-items: baseline; }
  #nav:popover-open .en { font: 300 30px/1.2 var(--serif); }
  #nav:popover-open .ja { font-size: 12px; }
  #nav:popover-open a::after { display: none; }
  #nav:popover-open .nav-close {
    display: grid; place-content: center; position: absolute; top: 10px; right: calc(var(--gut) - 10px);
    width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  }
  .nav-close span { display: block; width: 24px; height: 1.5px; background: var(--on-ink); grid-area: 1 / 1; }
  .nav-close span:first-child { transform: rotate(45deg); }
  .nav-close span:last-child { transform: rotate(-45deg); }
  #nav::backdrop { background: transparent; }
}

/* ---------- hero (home) ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: calc(100svh - var(--head));
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: 28px var(--gut) clamp(28px, 5vw, 56px);
  background: var(--ink); color: var(--on-ink);
  overflow: hidden;
}
.hero::before { /* film grain */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .09; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero::after { /* low warm glow on the horizon */
  content: ""; position: absolute; z-index: -2; left: 50%; bottom: 18%; width: 120vmax; height: 50vmax;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(229, 169, 93, .16), transparent 70%);
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--on-ink-mute); }
.hero-meta span:first-child { color: var(--on-ink); }
.hero-word {
  align-self: end;
  font: 300 clamp(88px, 21vw, 330px)/.82 var(--serif);
  font-variation-settings: "opsz" 144;
  letter-spacing: -.045em;
  margin-left: -.04em;
  view-transition-name: word;
}
.horizon { position: relative; height: 1px; background: var(--ink-line); margin: clamp(18px, 3vw, 34px) 0 0; }
.sun {
  position: absolute; right: clamp(24px, 12vw, 220px); bottom: 0;
  width: clamp(54px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%;
  background: var(--sun);
  margin-bottom: 1px;
}
.hero-index { display: grid; grid-template-columns: 1fr 1fr; border-top: 0; }
.hero-index a {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 18px; align-items: baseline;
  padding: 22px 0 0;
}
.hero-index li + li a { padding-left: clamp(16px, 3vw, 40px); border-left: 1px solid var(--ink-line); }
.hero-index .mono { color: var(--sun); grid-row: 1 / 3; }
.hero-index .en { font: 300 clamp(22px, 2.4vw, 34px)/1.15 var(--serif); }
.hero-index .ja { grid-column: 2; font-size: 12.5px; color: var(--on-ink-mute); letter-spacing: .08em; }
.hero-index .arr { grid-row: 1; grid-column: 3; width: 22px; height: 22px; margin-right: clamp(0px, 2vw, 24px); }
.hero-index a:hover .arr { transform: translate(4px, 0); color: var(--sun); }

@media (prefers-reduced-motion: no-preference) {
  .hero-word { animation: word-in 1.4s var(--ease) both; }
  .sun { animation: sunrise 2.2s .3s var(--ease) both; }
  .hero-meta, .hero-index { animation: fade 1.2s .6s var(--ease) both; }
  @keyframes word-in { from { opacity: 0; transform: translateY(.18em); filter: blur(10px); } }
  @keyframes sunrise { from { opacity: 0; transform: translateY(40%); } }
  @keyframes fade { from { opacity: 0; } }
}

/* ---------- business sections ---------- */
.biz {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 40px;
  padding: clamp(80px, 12vw, 168px) var(--gut);
  border-bottom: 1px solid var(--line);
}
.biz--alt { background: var(--paper-2); }
.biz-head { grid-column: 1 / 6; align-self: start; position: sticky; top: calc(var(--head) + 40px); }
.biz-head .mono { color: var(--mute); }
.biz h2, .page-head h1 { display: grid; gap: 6px; margin-top: 22px; }
.biz h2 .ja, .page-head h1 .ja { font: 500 clamp(30px, 3.6vw, 52px)/1.25 var(--ja); letter-spacing: .02em; }
.biz h2 .serif, .page-head h1 .serif { font-size: clamp(18px, 1.6vw, 24px); color: var(--mute); }
.biz-body { grid-column: 7 / 13; padding-top: 38px; }
.strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 28px); margin-top: clamp(24px, 6vw, 80px); }
.strip { align-items: start; }
.strip picture { display: block; overflow: hidden; }
.strip img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: saturate(.75) contrast(1.04); transition: transform 1.2s var(--ease), filter .6s; }
.strip picture:nth-child(2) { margin-top: clamp(28px, 8vw, 120px); }
.strip picture:nth-child(3) { margin-top: clamp(14px, 4vw, 60px); }
.strip picture:hover img { transform: scale(1.04); filter: none; }

/* ---------- inner pages ---------- */
.page-head {
  padding: clamp(72px, 11vw, 150px) var(--gut) clamp(56px, 7vw, 96px);
  background: var(--ink); color: var(--on-ink);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
}
.page-head > * { grid-column: 1 / -1; }
.page-head .mono { color: var(--sun); }
.page-head h1 { view-transition-name: title; }
.page-head h1 .serif { color: var(--on-ink-mute); }
.page-head .lead { grid-column: 7 / 13; margin-top: 36px; color: var(--on-ink); }
.sheet { padding: clamp(56px, 8vw, 120px) var(--gut); }

/* portfolio */
.pf { border-top: 1px solid var(--ink); }
.pf-row {
  display: grid; grid-template-columns: 56px 200px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 28px; align-items: center;
  padding: 30px 0; border-bottom: 1px solid var(--line);
  transition: background .5s var(--ease), padding .5s var(--ease);
}
.pf-row:hover { background: var(--paper-2); padding-inline: 16px; }
.pf-row .mono { color: var(--mute); }
.pf-logo { height: 64px; display: flex; align-items: center; }
.pf-logo img { max-height: 52px; width: auto; max-width: 160px; }
.pf-row h3 { font: 500 20px/1.4 var(--ja); }
.pf-row p { color: var(--mute); font-size: 15px; line-height: 1.85; }
.pf-row .link { margin-top: 0; }

/* company profile */
.profile { border-top: 1px solid var(--ink); max-width: 1100px; margin-left: auto; }
.profile > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.profile dt { font: 500 13px/1.9 var(--ja); color: var(--mute); letter-spacing: .06em; }
.profile dd { font-size: 17px; }
.profile a { background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; }

/* contact */
.contact { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 48px; }
.contact-side { grid-column: 1 / 5; }
.contact .tel { margin-top: 40px; display: grid; gap: 8px; }
.contact .tel .mono { color: var(--mute); }
.contact .tel a { font: 300 clamp(26px, 2.6vw, 36px)/1.2 var(--serif); }
.sailing-contact { grid-column: 6 / 13; display: grid; gap: 30px; }
.sailing-contact label { display: grid; gap: 4px; }
.sailing-contact label > span { font: 500 12.5px/1.6 var(--ja); letter-spacing: .08em; color: var(--mute); }
.sailing-contact .req { color: #b4532a; }
.sailing-contact input, .sailing-contact textarea {
  width: 100%; font: 400 17px/1.7 var(--ja); color: var(--ink);
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  transition: border-color .3s;
}
.sailing-contact textarea { resize: vertical; min-height: 9em; }
.sailing-contact input::placeholder, .sailing-contact textarea::placeholder { color: transparent; }
.sailing-contact input:focus, .sailing-contact textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.sailing-contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sailing-contact .form-msg { min-height: 1.6em; font-size: 14px; }
.sailing-contact .form-msg.err { color: #b4532a; }
.sailing-contact button {
  justify-self: start; display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 34px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--on-ink);
  font: 500 15px/1 var(--ja); letter-spacing: .2em;
  transition: background .3s, color .3s;
}
.sailing-contact button:hover { background: var(--sun); color: var(--ink); }
.sailing-contact button:hover .arr { transform: translateX(4px); }
.sailing-contact button[disabled] { opacity: .55; cursor: default; }

/* ---------- contact band + footer ---------- */
.cta {
  display: grid; justify-items: start; gap: 8px;
  padding: clamp(64px, 10vw, 140px) var(--gut);
  background: var(--ink); color: var(--on-ink);
  border-bottom: 1px solid var(--ink-line);
}
.cta .mono { color: var(--sun); }
.cta-big { display: inline-flex; align-items: center; gap: .25em; font: 300 clamp(56px, 11vw, 168px)/.95 var(--serif); letter-spacing: -.035em; }
.cta-big .arr { stroke-width: .9; width: .7em; height: .7em; }
.cta .ja { color: var(--on-ink-mute); letter-spacing: .1em; font-size: 14px; }
.cta:hover .arr { transform: translateX(.12em); color: var(--sun); }

.site-foot { background: var(--ink); color: var(--on-ink-mute); padding: 56px var(--gut) 28px; font-size: 14px; line-height: 1.9; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 40px; align-items: start; }
.foot-logo { height: 30px; width: auto; }
.site-foot .fname { margin-top: 14px; font: 300 18px/1.4 var(--serif); color: var(--on-ink); letter-spacing: .04em; }
.site-foot address .mono { display: block; color: var(--sun); margin-bottom: 8px; }
.site-foot a:hover { color: var(--on-ink); }
.foot-nav { display: grid; gap: 4px; justify-items: end; }
.site-foot .copy { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--ink-line); font: 400 11.5px/1.5 var(--mono); letter-spacing: .08em; }

/* ---------- scroll reveal (browsers with scroll-driven animations only) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .biz-body, .strip picture, .pf-row, .profile > div, .contact-side, .sailing-contact {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    @keyframes rise { from { opacity: 0; transform: translateY(32px); } }
  }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { min-height: 0; padding-top: 22px; }
  .hero-word { margin-top: clamp(56px, 16vw, 96px); }
  .hero-index { grid-template-columns: 1fr; }
  .hero-index li + li a { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink-line); margin-top: 18px; }
  .biz-head, .biz-body, .contact-side, .sailing-contact, .page-head .lead { grid-column: 1 / -1; }
  .biz-head { position: static; }
  .biz-body { padding-top: 0; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .pf-row { grid-template-columns: 40px 1fr; gap: 10px 16px; padding: 26px 0; }
  .pf-row:hover { padding-inline: 0; }
  .pf-row > :not(.mono) { grid-column: 2; }
  .pf-logo { height: auto; margin-bottom: 6px; }
  .profile > div { grid-template-columns: 1fr; gap: 2px; padding: 18px 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-nav { justify-items: start; grid-template-columns: repeat(2, auto); justify-content: start; column-gap: 28px; }
}
@media (max-width: 520px) {
  .hero-meta span:last-child { display: none; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip picture:nth-child(3) { display: none; }
}

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--sun); color: var(--ink); font-size: 14px; }
.skip:focus { top: 12px; }
