:root {
  --ink: #34362f;
  --muted: #74766d;
  --line: rgba(74, 78, 65, .16);
  --surface: rgba(250, 248, 240, .82);
  --navy: #f4f0e6;
  --blue: #66745e;
  --violet: #b88968;
  --sans: "DM Sans", "Noto Sans JP", sans-serif;
  --serif: "Shippori Mincho", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(191, 176, 135, .24), transparent 32rem),
    linear-gradient(155deg, #f7f3e9 0%, #efeee5 55%, #e9ede3 100%);
  font-family: var(--sans);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; width: 32rem; height: 32rem; filter: blur(120px); border-radius: 50%; pointer-events: none; opacity: .14; }
.ambient-one { background: #9eaa86; top: 20%; right: -15rem; }
.ambient-two { background: #c7a987; bottom: 5%; left: -20rem; }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: .72rem; letter-spacing: .16em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid rgba(74, 78, 65, .35); border-radius: 50%;
  font-family: var(--serif); font-size: 1rem;
}
nav { display: flex; gap: 38px; font-size: .78rem; color: var(--muted); }
nav a:hover { color: var(--ink); }
.edit-trigger, .icon-button {
  border: 1px solid var(--line); background: rgba(255,255,255,.35);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.admin-only { display: none; }
.admin-mode .edit-trigger.admin-only { display: inline-flex; align-items: center; gap: 6px; }
.admin-mode .auth-panel.admin-only { display: flex; align-items: center; gap: 8px; }
.edit-trigger:hover { border-color: rgba(81, 95, 73, .45); background: rgba(255,255,255,.68); }
.edit-trigger:disabled { opacity: .45; cursor: wait; }
.auth-panel { font-size: .68rem; color: var(--muted); }
.auth-panel button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.36);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.hero {
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 92px);
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 90px 0 120px;
}
.eyebrow, .kicker { color: var(--blue); font-size: .68rem; letter-spacing: .26em; }
.hero h1 {
  position: relative; z-index: 2; margin: 22px 0 30px;
  font-family: var(--serif); font-size: clamp(3rem, 6.7vw, 6.8rem);
  font-weight: 500; line-height: 1.25; letter-spacing: -.035em;
}
.hero h1 em { color: #78806c; -webkit-text-stroke: 0; font-style: normal; }
.hero-copy { width: min(620px, 65%); color: var(--muted); font-weight: 300; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 24px;
  padding: 12px 20px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; background: transparent;
}
.button.primary { color: #f9f7f0; background: #596651; border: 0; }
.button.ghost { background: rgba(255,255,255,.38); color: var(--ink); }
.hero-orbit { position: absolute; width: 390px; height: 390px; right: 2%; top: 51%; transform: translateY(-50%); }
.botanical { opacity: .86; }
.leaf { position: absolute; border: 1px solid rgba(88, 105, 76, .34); border-radius: 100% 0 100% 0; background: linear-gradient(145deg, rgba(133, 153, 117, .25), rgba(255,255,255,.08)); }
.leaf-one { width: 190px; height: 290px; left: 28px; top: 62px; transform: rotate(-22deg); }
.leaf-two { width: 160px; height: 245px; right: 12px; top: 7px; transform: rotate(34deg); }
.leaf-three { width: 120px; height: 190px; right: 24px; bottom: 0; transform: rotate(74deg); }
.sun-disc { position: absolute; width: 128px; height: 128px; border-radius: 50%; left: 135px; top: 132px; background: rgba(191, 156, 112, .22); box-shadow: 0 0 80px rgba(172, 146, 109, .2); }
.orbit-ring { display: none; }
.ring-one::before, .ring-two::before { content: ""; position: absolute; width: 7px; height: 7px; background: var(--blue); border-radius: 50%; top: 35px; left: 76px; box-shadow: 0 0 18px var(--blue); }
.ring-two { inset: 52px; animation-direction: reverse; animation-duration: 28s; }
.ring-two::before { top: auto; left: auto; right: 5px; bottom: 89px; background: var(--violet); }
.core {
  position: absolute; inset: 120px; border-radius: 50%; display: grid; place-items: center;
  text-align: center; line-height: 1.1; letter-spacing: .15em; font-size: 1.1rem;
  background: radial-gradient(circle at 35% 30%, rgba(221, 232, 255, .28), rgba(90, 117, 184, .08));
  border: 1px solid rgba(211, 223, 255, .28); box-shadow: inset 0 0 35px rgba(163, 189, 255, .1), 0 0 45px rgba(76, 103, 173, .12);
}
.core small { color: var(--muted); }
.orbit-label { position: absolute; color: var(--muted); font-size: .63rem; letter-spacing: .2em; }
.label-one { top: 10px; left: 48%; }.label-two { right: -7px; bottom: 75px; }.label-three { left: -15px; bottom: 100px; }
@keyframes spin { to { transform: rotate(360deg); } }
.scroll-note { position: absolute; bottom: 25px; left: 0; color: #6f7f9d; font-size: .58rem; letter-spacing: .22em; }
.scroll-note span { padding-left: 12px; }

.section { width: min(1180px, calc(100% - 48px)); margin: auto; padding: 145px 0; border-top: 1px solid var(--line); position: relative; }
.section-heading { display: grid; grid-template-columns: 1.2fr .8fr; gap: 80px; align-items: end; margin-bottom: 68px; }
.section-heading.compact { margin-bottom: 54px; }
.section-heading > p { color: var(--muted); max-width: 440px; }
.section-number { position: absolute; top: 142px; right: 0; color: #6e7b94; font-size: .65rem; letter-spacing: .2em; }
.section h2 { margin: 10px 0 0; font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 4.3rem); font-weight: 500; line-height: 1.45; }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.project-card {
  grid-column: span 6; min-height: 390px; display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; overflow: hidden; padding: 32px; border: 1px solid var(--line); border-radius: 2px;
  background: linear-gradient(145deg, rgba(250, 248, 240, .75), rgba(223, 228, 214, .7));
}
.project-card:nth-child(3n) { grid-column: span 12; }
.project-card::before {
  content: ""; position: absolute; width: 300px; height: 300px; top: -150px; right: -90px;
  border-radius: 50%; border: 1px solid rgba(96, 113, 83, .15); box-shadow: 0 0 80px rgba(105, 127, 93, .08);
}
.project-card > * { position: relative; }
.project-index { color: #8292ae; font-size: .65rem; letter-spacing: .2em; margin-bottom: auto; }
.project-card h3 { font-family: var(--serif); font-size: 1.8rem; margin: 0 0 10px; }
.project-card p { color: var(--muted); margin: 0; max-width: 580px; font-size: .9rem; }
.project-tags { display: flex; gap: 8px; margin-top: 20px; }
.project-tags span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: #6d7565; font-size: .62rem; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.badge-card { padding: 28px; border: 1px solid var(--line); background: rgba(250, 248, 240, .58); min-height: 240px; }
.badge-symbol {
  width: 70px; height: 70px; display: grid; place-items: center; margin-bottom: 34px;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  background: linear-gradient(145deg, rgba(119, 139, 105, .28), rgba(190, 153, 119, .2)); font-size: 1.5rem;
}
.badge-card h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 6px; }
.badge-card p { color: var(--muted); font-size: .75rem; margin: 0; }
.badge-card a { display: inline-block; color: var(--blue); font-size: .7rem; margin-top: 16px; }
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 100px; }
.about-copy > p { color: #565c50; font-family: var(--serif); font-size: 1.18rem; }
dl { margin-top: 50px; }
dl div { display: grid; grid-template-columns: 110px 1fr; padding: 15px 0; border-top: 1px solid var(--line); }
dt { color: #71809d; font-size: .65rem; text-transform: uppercase; letter-spacing: .14em; }
dd { margin: 0; color: #596052; font-size: .82rem; }
body > footer {
  width: min(1180px, calc(100% - 48px)); margin: auto; padding: 36px 0;
  display: flex; justify-content: space-between; border-top: 1px solid var(--line);
  color: #61708c; font-size: .58rem; letter-spacing: .14em;
}

dialog { width: min(850px, calc(100% - 28px)); height: min(820px, calc(100vh - 40px)); padding: 0; border: 1px solid rgba(78, 88, 70, .25); background: #f5f1e8; color: var(--ink); box-shadow: 0 30px 100px rgba(38, 41, 34, .35); }
dialog::backdrop { background: rgba(47, 49, 42, .55); backdrop-filter: blur(8px); }
.editor-shell { height: 100%; display: flex; flex-direction: column; }
.editor-header { display: flex; justify-content: space-between; align-items: start; padding: 24px 28px 16px; }
.editor-header h2 { margin: 3px 0 0; font-family: var(--serif); font-size: 1.8rem; }
.icon-button { width: 38px; height: 38px; padding: 0; font-size: 1.4rem; }
.editor-tabs { display: flex; gap: 5px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px 15px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-color: var(--blue); }
.editor-content { flex: 1; overflow-y: auto; padding: 26px 28px; }
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 18px; }
.tab-panel label { display: grid; gap: 7px; color: #a9b7cf; font-size: .75rem; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.55); color: var(--ink); padding: 11px 13px; outline: none; resize: vertical; }
input:focus, textarea:focus { border-color: rgba(158, 189, 255, .55); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-item { position: relative; display: grid; gap: 12px; padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
.remove-item { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; color: #c89fa8; cursor: pointer; }
.add-button { width: 100%; border: 1px dashed rgba(174, 197, 255, .3); background: transparent; padding: 12px; cursor: pointer; color: var(--blue); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; padding: 15px 28px; border-top: 1px solid var(--line); }
.editor-footer span { color: #71809d; font-size: .7rem; }
.backup-card { padding: 20px; border: 1px solid var(--line); }
.backup-card h3 { margin-top: 0; }
.backup-card p { color: var(--muted); font-size: .8rem; }
.file-button { display: inline-block !important; width: fit-content; padding: 10px 18px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.file-button input { display: none; }
.danger-button { border: 0; background: transparent; color: #d8a6ae; cursor: pointer; width: fit-content; padding: 10px 0; }

.resume-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.resume-title { margin: 0 0 22px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.timeline-item, .qualification-item { display: grid; grid-template-columns: 135px 1fr; gap: 20px; padding: 25px 0; border-top: 1px solid var(--line); }
.timeline-period, .qualification-item > span { margin: 0; color: #8a806c; font-size: .72rem; letter-spacing: .08em; }
.timeline-item h3, .qualification-item h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.08rem; font-weight: 500; }
.timeline-item div p, .qualification-item div p { margin: 0; color: var(--muted); font-size: .82rem; }

@media (max-width: 800px) {
  nav { display: none; }
  .site-header { flex-wrap: wrap; gap: 12px; }
  .admin-mode .auth-panel.admin-only { width: 100%; justify-content: flex-end; }
  .site-header, .hero, .section, body > footer { width: min(100% - 30px, 1180px); }
  .hero { padding-top: 70px; min-height: 830px; justify-content: flex-start; }
  .hero h1 { font-size: clamp(2.7rem, 12vw, 4.6rem); }
  .hero-copy { width: 100%; }
  .hero-orbit { width: 290px; height: 290px; right: 50%; top: auto; bottom: 75px; transform: translateX(50%); opacity: .8; }
  .core { inset: 90px; }
  .section { padding: 95px 0; }
  .section-number { top: 92px; }
  .section-heading, .about-layout { grid-template-columns: 1fr; gap: 30px; }
  .project-card, .project-card:nth-child(3n) { grid-column: span 12; min-height: 330px; }
  .badge-grid { grid-template-columns: 1fr; }
  .resume-layout { grid-template-columns: 1fr; gap: 55px; }
  body > footer { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .editor-footer span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; }
}
