:root {
    --bg-dark: #111213;
    --fg-light: #d6d6d6;
    --matrix-green: #00bfff;
    --bg-light: #ffffff;
    --fg-dark: #111213;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding: 0 10px;
    margin: 50px auto;
    max-width: 650px;
    background-color: var(--bg-dark);
    color: var(--fg-light);
    font-family: "SF Mono", "SFMono-Regular", ui-monospace,
        Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light {
    background-color: var(--bg-light);
    color: var(--fg-dark);
}

.toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: none;
    border-radius: 999px;
    background: rgba(17, 18, 19, 0.6);
    color: var(--fg-light);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 1000;
}

body.light .toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--fg-dark);
}

.toggle-btn:hover,
.toggle-btn:focus {
    background-color: rgba(0, 191, 255, 0.15);
}

body.light .toggle-btn:hover,
body.light .toggle-btn:focus {
    background-color: rgba(0, 191, 255, 0.1);
}

.toggle-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.toggle-switch {
    position: relative;
    width: 32px;
    height: 16px;
    border-radius: 999px;
    background: rgba(214, 214, 214, 0.3);
    transition: background-color 0.3s ease;
}

.toggle-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--matrix-green);
    transition: transform 0.3s ease;
}

body.light .toggle-switch {
    background: rgba(17, 18, 19, 0.2);
}

body.light .toggle-switch::before {
    transform: translateX(16px);
}

#maincontent {
    max-width: 42em;
    margin: 15px auto;
}

h1 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    line-height: 1.4;
}

p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

h2 {
    font-size: 1rem;
    font-weight: 400;
    margin-top: 40px;
    margin-bottom: 20px;
    text-transform: lowercase;
}

.project {
    margin-bottom: 15px;
}

.project strong {
    font-weight: 600;
    color: var(--matrix-green);
}

.footer {
    margin-top: 40px;
    font-weight: 400;
}

a {
    color: var(--matrix-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.accent {
    color: var(--matrix-green);
    font-weight: 600;
}

.form-wrapper {
    margin-top: 40px;
}

.success-message {
    display: none;
    margin-top: 30px;
    padding: 20px;
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 6px;
    background: rgba(0, 191, 255, 0.08);
}

.success-message h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.success-message p {
    margin: 0;
}

[data-form-wrapper].is-submitted form {
    display: none;
}

[data-form-wrapper].is-submitted .success-message {
    display: block;
}

form {
    display: grid;
    gap: 15px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--matrix-green);
}

body.light label {
    color: #008000;
}

input,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(214, 214, 214, 0.2);
    background: rgba(17, 18, 19, 0.6);
    color: var(--fg-light);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body.light input,
body.light textarea {
    background: rgba(255, 255, 255, 0.9);
    color: var(--fg-dark);
    border-color: rgba(17, 18, 19, 0.2);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--matrix-green);
}

button[type="submit"] {
    justify-self: start;
    padding: 10px 18px;
    border: 1px solid var(--matrix-green);
    background: transparent;
    color: var(--matrix-green);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
    background-color: var(--matrix-green);
    color: var(--bg-dark);
}

body.light button[type="submit"] {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

body.light button[type="submit"]:hover,
body.light button[type="submit"]:focus {
    background-color: var(--matrix-green);
    color: var(--bg-light);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 0.85rem;
}

.back-link svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.toast {
    display: none;
    margin-top: 15px;
    padding: 10px 14px;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    font-size: 0.85rem;
}

.toast.visible {
    display: block;
}

body.light .toast {
    border-color: #008000;
    color: #008000;
}
